Resetting Git in VSCode? - node.js

I have a node git project open in VSCode and I did not add a .gitignore initially so all the node_modules files got staged on npm i.
I then added a .gitignore with node_modules/ in it, but the files are not being ignored. I then rm -fr node_modules .vscode and I do not have a .git folder in the project, yet the files are still showing as staged and if I click on them they open, so VSCode is holding on to them somehow. This is the result of ls -la on the project:
total 36
drwxr-xr-x 3 ole ole 4096 Mar 25 12:23 .
drwxr-xr-x 22 ole ole 4096 Mar 23 23:55 ..
-rw-r--r-- 1 ole ole 13 Mar 25 12:26 .gitignore
-rw-r--r-- 1 ole ole 280 Mar 22 16:50 jest.config.js
-rw-r--r-- 1 ole ole 303 Mar 24 21:53 package.json
-rw-r--r-- 1 ole ole 379 Mar 24 21:53 package-lock.json
drwxr-xr-x 4 ole ole 4096 Mar 24 22:42 src
-rw-r--r-- 1 ole ole 5561 Mar 22 18:33 tsconfig.json
Thoughts on how to reset the project so that it only shows the non node_modules files?
Update
Instead of using VSCode to perform the first commit I used the commandline, and it shows the correct results. However VSCode still shows a bunch of files from other parts of the file system that are not part of the project even after the first commit.
Also if I switch to a different project cd ../differentproject and run code . it still shows the same uncommited files for that project ...

Related

PostgreSQL create extension mongo_fdw

I want to connect a PostgreSQL database with a MongoDB by using Mongo_fdw. After following this instruction to install mongo_fdw with the autogen.sh script on Ubuntu 22.04 LTS, I wanted to check the connection and ran CREATE EXTENSION mongo_fdw; in my database, but the following error occured:
ERROR: could not access file "$libdir/mongo_fdw": No such file or directory
Searchig for a solution I found this page on GitHub, where the same error is discussed. Following the recommendations there, I checked pg_config --version, pg_config --libdir and pg_config --sharedir with the following results:
$ pg_config --version
PostgreSQL 12.9
$ pg_config --libdir
/home/qgis/anaconda3/lib
$ pg_config --sharedir
/home/qgis/anaconda3/share
When I check /home/qgis/anaconda3/share/extension I get the following files:
drwxrwxr-x 2 qgis qgis 4096 Feb 1 10:58 ./
drwxrwxr-x 32 qgis qgis 4096 Jan 18 10:28 ../
-rw-r--r-- 1 root root 157 Feb 1 10:58 mongo_fdw--1.0--1.1.sql
-rw-r--r-- 1 root root 593 Feb 1 10:58 mongo_fdw--1.0.sql
-rw-r--r-- 1 root root 709 Feb 1 10:58 mongo_fdw--1.1.sql
-rw-r--r-- 1 root root 274 Feb 1 10:58 mongo_fdw.control
-rw-rw-r-- 2 qgis qgis 310 Jun 24 2022 plpgsql--1.0.sql
-rw-rw-r-- 2 qgis qgis 179 Jun 24 2022 plpgsql.control
-rw-rw-r-- 2 qgis qgis 370 Jun 24 2022 plpgsql--unpackaged--1.0.sql
I also ran ldconfig as it is recommended on the GitHub page but with no results.
Does someone has an idea how to solve this error?
Thanks in advance!
You have to specify the correct pg_config when building the software, probably
make PG_CONFIG=/usr/lib/postgresql/14/bin/pg_config
That file should exist if you installed the package with the C headers, which is typically called "devel" or "dev" or similar.

npm ERR! Load key "/opt/app-root/src/.ssh/id_rsa": bad permissions in OCP S2I build

I have node applications where some dependency git repos specified in package.json and deploying using S2I in OCP. To clone the repos I have mounted the sshkey as a secret into /opt/app-root/src/.ssh .. But the permissions are coming default 6 to group that is root. And failing with error npm ERR! Load key "/opt/app-root/src/.ssh/id_rsa": bad permissions. Couple of suggestions from different git links are 1. Use hostpath 2. Runas root 3. Set fsGroup. How can I apply any of these changes into buildConfig? What ever I set in deployConfig is not reflecting for build.
ls -lasL /opt/app-root/src/.ssh
total 20
0 drwxr-xr-x. 3 default root 92 Jan 20 17:35 .
0 drwxrwxr-x. 1 default root 18 Jan 20 17:35 ..
0 drwxr-xr-x. 2 default root 39 Jan 20 17:35 ..2023_01_20_17_35_25.328954621
0 drwxr-xr-x. 2 default root 39 Jan 20 17:35 ..data
4 -rw-------. 1 default root 2610 Jan 20 17:35 id_rsa
16 -rw-------. 1 default root 12403 Jan 20 17:35 known_hosts

webpack unable to resolve node module in docker image

#Dockerfile
FROM node:alpine
RUN mkdir /morty
ADD . /morty/
WORKDIR /morty/
RUN yarn cache clean && yarn install
RUN ls node_modules | grep autosuggest
RUN find /morty/node_modules/react-autosuggest -ls
CMD npm run dev
This builds as expected, but as soon as I request a page from the dev server, I get an error
ERROR in ./src/components/molecules/AutoSuggest/index.js
web_1 | Module not found: Error: Can't resolve 'react-autosuggest' in '/morty/src/components/molecules/AutoSuggest'
web_1 | #
which would suggest to me that for some reason, the react-autosuggest module was not installed; however, the output of step 6 & 7 in my Dockerfile seems to invalidate that hypothesis.
Step 6/7 : RUN ls node_modules | grep autosuggest
---> Running in 0c87c4318a6f
react-autosuggest
Step 7/9 : RUN find /morty/node_modules/react-autosuggest -ls
---> Running in 498c6b9080c7
12042711 4 drwxr-xr-x 3 root root 4096 Mar 6 16:40 /morty/node_modules/react-autosuggest
12042729 4 drwxr-xr-x 3 root root 4096 Mar 6 16:40 /morty/node_modules/react-autosuggest/dist
521128 4 -rw-r--r-- 1 root root 1735 Mar 6 16:40 /morty/node_modules/react-autosuggest/dist/theme.js
12042731 4 drwxr-xr-x 2 root root 4096 Mar 6 16:40 /morty/node_modules/react-autosuggest/dist/standalone
521127 36 -rw-r--r-- 1 root root 33193 Mar 6 16:40 /morty/node_modules/react-autosuggest/dist/standalone/autosuggest.min.js
521126 112 -rw-r--r-- 1 root root 113248 Mar 6 16:40 /morty/node_modules/react-autosuggest/dist/standalone/autosuggest.js
521123 28 -rw-r--r-- 1 root root 27217 Mar 6 16:40 /morty/node_modules/react-autosuggest/dist/Autosuggest.js
521124 4 -rw-r--r-- 1 root root 65 Mar 6 16:40 /morty/node_modules/react-autosuggest/dist/index.js
521121 24 -rw-r--r-- 1 root root 24423 Mar 6 16:40 /morty/node_modules/react-autosuggest/README.md
521129 8 -rw-r--r-- 1 root root 4195 Mar 6 16:40 /morty/node_modules/react-autosuggest/package.json
521120 4 -rw-r--r-- 1 root root 1088 Mar 6 16:40 /morty/node_modules/react-autosuggest/LICENSE
package.json does contain the entry "react-autosuggest": "^9.3.4", in dependencies and the app performs as expected in its un-containerized form.
also, possibly relevant is that the base config for this project came from
the Arc project
I also faced this issue while trying to build my npm project using a container which had WORKDIR as a mounted volume. I resolved this issue by removing the mounted volume by name.
docker volume ls to list the volumes
DRIVER VOLUME NAME
local myproject_named_volume
docker volume rm -f myproject_named_volume to remove the volume
Hope this helps.

CentOS and fontconfig: Cannot load default config file

I'm getting following error when using imagick:
Fontconfig error: Cannot load default config file
My script is working but i would like to fix this (is filling up log file).
OS is:
# cat /etc/redhat-release
CentOS release 5.10 (Final)
I was looking trough internet little bit and this is causing problem:
access("/etc/fonts/fonts.conf", R_OK) = -1 ENOENT (No such file or directory)
Folder exists:
# ls /etc/fonts/ -all
total 64
drwxr-xr-x 4 root root 4096 Jul 9 2010 ./
drwxr-xr-x 86 root root 12288 Jan 13 00:48 ../
drwxr-xr-x 2 root root 4096 Jan 3 2012 conf.avail/
drwxr-xr-x 2 root root 4096 Apr 14 2013 conf.d/
-rw-r--r-- 1 root root 5239 Jan 12 2008 fonts.conf
-rw-r--r-- 1 root root 6907 Jan 12 2008 fonts.dtd
But i see only this folder via root account, other account under with script is run doesn't see this folder. Permissions looks fine for me, but not so experienced with linux.
Account under with script is run is created with WHM.
Please help :)
I manage to solve my problem. chroot was making trouble.
I need to:
log with root account
find jailed environment of account on with i run script (in my case /home/virtfs/[username])
to create folder where i will mount real stuff mkdir /home/virtfs/[username]/etc/fonts
to mount /etc/fonts to this folder: mount --bind /etc/fonts /home/virtfs/[username]/etc/fonts
Posting an answer for CentOS 7 in 2021:
yum install fontconfig
More info here:
https://centos.pkgs.org/7/centos-x86_64/fontconfig-2.13.0-4.3.el7.x86_64.rpm.html

svn permission issue - txn-current-lock: Permission denied

I setup svn on my local system /svn/repos/myproject by following this tutorial. I'm able to view the repo in browser.
But when it try to import new project I couldn't through svn client ( rapid svn ) it shows following error:
Execute: Import
Error while performing action:
Can't open file '/svn/repos/myproject/db/txn-current-lock': Permission denied
Svn directory permissions:
→ ls -l /svn
total 12
drwxrwxr-x 2 root root 4096 Feb 15 12:09 permissions
drwxrwxr-x 4 apache apache 4096 Feb 15 12:09 repos
drwxrwxr-x 2 root root 4096 Feb 15 12:09 users
Repo directory:
→ ls -l
total 8
drwxrwxr-x 3 root root 4096 Feb 15 12:09 conf
drwxrwxr-x 7 apache apache 4096 Feb 15 12:09 myproject
How to solve this issue?
I've given 777 permission to repos directory which solved this issue. But i got another issue like Couldn't perform atomic initialization.
I think this is due to incompatible sqlite version with subversion we're using, this can be solved by updating svnadmin command,
svnadmin create --pre-1.6-compatible --fs-type fsfs /svn/repos/myproject

Resources