How to distinguish the vscode workspace folder? - visual-studio-code

lgg#DESKTOP-BMR5HSI:~/.vscode-server/data/User/workspaceStorage$ ll
total 32
drwxr-xr-x 8 lgg lgg 4096 Nov 13 21:04 ./
drwxr-xr-x 4 lgg lgg 4096 Nov 4 15:45 ../
drwxr-xr-x 3 lgg lgg 4096 Nov 13 21:03 1505181e6052a03abe79042e8bcfdd40/
drwxr-xr-x 2 lgg lgg 4096 Nov 13 21:07 341a5d2d03d5a64ce58dce3771dac3b1/
drwxr-xr-x 3 lgg lgg 4096 Nov 13 21:09 3b9c4219014f64ec29dd383ed3fbbf22/
drwxr-xr-x 3 lgg lgg 4096 Nov 13 21:08 88f5f1b6a49f6f00e103a56adffb3c6e/
drwxr-xr-x 3 lgg lgg 4096 Nov 13 21:04 89f25165af6ff305f0f731e8ef4c6168/
drwxr-xr-x 3 lgg lgg 4096 Nov 13 21:04 ce3c4d069b58e0dbb6f66aa658bc9e93/
LinGuanguo#DESKTOP-BMR5HSI MINGW64 ~/AppData/Roaming/Code/User/workspaceStorage
$ ll
total 104
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 13 21:07 .
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 9 13:32 ..
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 4 19:50 127122aeb91c48b270b04d66d41519fe
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 13 21:03 1505181e6052a03abe79042e8bcfdd40
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 11 22:23 1cf9e5989394bac1441390a899e29a59
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 11 11:04 2f7c21953e4720ec2da7a75cf936ec58
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 13 21:07 341a5d2d03d5a64ce58dce3771dac3b1
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 13 21:11 3b9c4219014f64ec29dd383ed3fbbf22
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 6 22:46 3e244c4a9f5307bb6e8d698e2018f7f8
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 11 17:29 3f80eb3c628ea4ca4b54afdf25007ab2
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 4 15:49 5b46f75dd3aeb4d80b002e341ddbafb4
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 11 11:10 5e36229235ec81e2244743a2eb401316
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 13 20:43 6035ef9adf7f887e614eb7a8f51ba89a
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 4 20:00 7e0ba18ec97371445afce32a443648b6
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 13 21:08 88f5f1b6a49f6f00e103a56adffb3c6e
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 13 21:04 89f25165af6ff305f0f731e8ef4c6168
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 4 20:10 a3d4c8f6efaf46e48d356d96e70c2bc7
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 13 20:54 b975249a5633acd47927412a74c05e29
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 11 20:43 bbb5565824723bea6acccb7885b4a88f
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 9 17:52 bbc0500b79cabef3a1039237a7a521c6
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 13 18:36 beb6c5139504366d0a793188f2358174
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 13 21:04 ce3c4d069b58e0dbb6f66aa658bc9e93
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 8 17:26 d6f908ee23f82eac7a67893b81676e4c
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 13 20:52 ddd1b8bc9902b061f64f1b35fd5b228b
drwxr-xr-x 1 LinGuanguo 197609 0 Nov 12 00:00 fc712a231342bc69c0fef503c95208b8
there are a lot of vscode workspace directory in my windows and WSL. How do I distinguish between them and the actual workspace. their name are random.
There are a lot of useful things in them, such as C++'s intellisense cache, but most of them is garbage. I just open a folder once, then vscode save a lot of garbage. I just want to delete them, not rm -r -f *.
The only way I know now is that when I open a workspace, the corresponding folder will appear vscode.lock
lgg#DESKTOP-BMR5HSI:~/.vscode-server/data/User/workspaceStorage$ tree
.
├── 1505181e6052a03abe79042e8bcfdd40
│   └── ms-vscode.cpptools
├── 341a5d2d03d5a64ce58dce3771dac3b1
├── 3b9c4219014f64ec29dd383ed3fbbf22
│   ├── ms-vscode.cpptools
│   └── vscode.lock
├── 88f5f1b6a49f6f00e103a56adffb3c6e
│   └── ms-vscode.cpptools
├── 89f25165af6ff305f0f731e8ef4c6168
│   └── ms-vscode.cpptools
└── ce3c4d069b58e0dbb6f66aa658bc9e93
└── ms-vscode.cpptools

Many folders contain a file workspace.json with a folder property.
Some folders only contain a file meta.json that contain the name of one of the workspaces from a Multi Root Workspace. Not very useful because the Multi Root Workspace file already contains these names and locations.
Some folders with a meta.json contain a state.vscdb.
It looks like the folders with meta.json are from a previous version of VSC because they all have dates from years ago (2018/2019).

Related

cannot create directory for 'local::lib'

I have installed local::lib from cpan. But the manually one more again to make bootstrap - perl Makefile.PL −−bootstrap. And although I have already a file lib.pm here /usr/share/perl5/local/lib.pm, it when trying to bootstrap it (with the command mentioned above) this error rises:
Loading internal logger. Log::Log4perl recommended for better logging
Attempting to create directory /home/shepherd/perl5
Unable to create /home/shepherd/perl5/lib/perl5/5.28.0: No such file or directory at /usr/share/perl5/local/lib.pm line 717.
So if I have installed the module, and have it may dir, why the bootstrap cannot create /home/shepherd/perl5/lib/perl5/5.28.0 ?
I have and own this files:
ls -l ~/perl5
drwxrwxr-x 2 root root 4096 Nov 18 23:03 bin
drwxrwxr-x 3 root root 4096 Oct 28 18:52 lib
drwxrwxr-x 4 root root 4096 Oct 28 18:52 man
ls -l ~/perl5/lib
drwxrwxr-x 25 root root 4096 Nov 21 08:56 perl5
ls -l ~perl5/lib/perl5
drwxrwxr-x 2 root root 4096 Nov 20 19:54 B
drwxrwxr-x 3 root root 4096 Nov 21 08:56 Business
drwxrwxr-x 3 root root 4096 Oct 28 19:08 Class
drwxrwxr-x 2 root root 4096 Nov 20 19:54 Config
drwxrwxr-x 3 root root 4096 Oct 28 19:09 Devel
drwxrwxr-x 2 root root 4096 Oct 28 19:08 Dist
drwxrwxr-x 3 root root 4096 Nov 20 19:54 File
drwxrwxr-x 2 root root 4096 Nov 20 19:54 Hook
-r--r--r-- 1 root root 42537 Feb 18 2018 Importer.pm
drwxrwxr-x 3 root root 4096 Oct 28 19:10 IPC
drwxrwxr-x 3 root root 4096 Nov 18 23:03 Log
drwxrwxr-x 3 root root 4096 Nov 20 20:48 Mac
drwxrwxr-x 3 root root 4096 Oct 28 19:09 MIME
drwxrwxr-x 3 root root 4096 Oct 28 18:52 Module
-r--r--r-- 1 root root 967 Sep 6 16:40 ok.pm
drwxrwxr-x 2 root root 4096 Nov 19 23:13 OLE
drwxrwxr-x 3 root root 4096 Oct 28 19:08 Perl
drwxrwxr-x 3 root root 4096 Oct 28 19:09 POD2
drwxrwxr-x 2 root root 4096 Oct 28 19:09 Scope
drwxrwxr-x 2 root root 4096 Nov 20 19:56 String
drwxrwxr-x 2 root root 4096 Nov 20 19:54 Task
drwxrwxr-x 3 root root 4096 Oct 28 19:09 Term
drwxrwxr-x 9 root root 4096 Nov 20 19:54 Test
drwxrwxr-x 10 root root 4096 Oct 28 19:09 Test2
-r--r--r-- 1 root root 6393 Sep 6 16:40 Test2.pm
drwxrwxr-x 7 root root 4096 Nov 20 19:55 x86_64-linux-gnu-thread-multi
local::lib misreports the error reason. In this particular case, the problem is that the user running the program (shepherd) doesn't have permission to write to /home/shepherd/perl5/lib/perl5 in order to create /home/shepherd/perl5/lib/perl5/5.28.0.
The user will need to be granted the ability to write to that directory. This should probably be done by changing the ownership of the files from root to shepherd.
chown -R shepherd:shepherd ~/perl5

Command 'scala' not found on Ubuntu 18.04

I downloaded scala,unpacked it and copied to /usr/local/share
After that,I edited ~/.bashrc
export SCALA_HOME=/usr/local/share/scala-2.12.8
export PATH=$PATH:$SCALA_HOME/bin
Anyway,it does not work.
scala -version
Command 'scala' not found, but can be installed with:
sudo apt install scala
I could go for apt install but I don't get it what is wrong.
/usr/local/share$ ll
total 48
drwxr-xr-x 12 root root 4096 јул 1 06:03 ./
drwxr-xr-x 14 root root 4096 јун 23 18:04 ../
drwxr-xr-x 2 root root 4096 апр 21 08:04 appdata/
drwxr-xr-x 2 root root 4096 јун 25 21:03 applications/
drwxr-xr-x 2 root root 4096 јул 25 2018 ca-certificates/
drwxrwsr-x 3 root staff 4096 јул 25 2018 emacs/
drwxrwsr-x 2 root staff 4096 јул 25 2018 fonts/
drwxr-xr-x 3 root root 4096 апр 19 08:44 lua/
drwxr-xr-x 2 root root 4096 јул 25 2018 man/
drwxrwxr-x 6 miki miki 4096 дец 4 2018 scala-2.12.8/
drwxrwsr-x 7 root staff 4096 мај 14 15:05 sgml/
drwxrwsr-x 6 root staff 4096 мај 14 15:05 xml/
Editing .bashrc won't affect an already open shell. You could explicitly source it (source ~/.bashrc) to have it take effect, or open a new shell to reload it.

Using find vs. locate vs. whereis

I am doing Chapter 1 exercises from Linux Basics for Hackers (Starch Press):
Create a new directory called hackerdirectory and create a new file in
that directory named hackedfile. Now copy that file to your /root
directory and then rename it secretfile.
So I did mkdir hackerdirectory then cd hackerdirectory then touch hackedfile then sudo mv hackedfile /root
My understanding is that /root is the top home directory but when I cd .. back to home and ls -l, it's not there:
drwxrwxr-x 23 nobu nobu 4096 Jul 9 18:24 anaconda3
-rw-r--r-- 1 nobu nobu 4243 May 3 02:10 backblue.gif
-rw-rw-r-- 1 nobu nobu 25120 Mar 23 07:02 CERTIFICATE
drwxrwxr-x 3 nobu nobu 4096 Mar 30 05:01 client-configs
-rw-rw-r-- 1 nobu nobu 412 May 3 03:18 cookies.txt
-rw------- 1 root root 8560640 Apr 11 09:59 core
drwxr-xr-x 3 nobu nobu 4096 Sep 11 20:34 ctf
drwxr-xr-x 18 nobu nobu 4096 Sep 13 12:33 Desktop
drwxr-xr-x 4 nobu nobu 4096 Sep 8 18:59 Diamondhead
drwxrwxr-x 6 nobu nobu 4096 Sep 15 16:42 Documents
drwxr-xr-x 27 nobu nobu 12288 Sep 17 14:28 Downloads
-rw-r--r-- 1 nobu nobu 8980 Mar 20 06:44 examples.desktop
-rw-r--r-- 1 nobu nobu 828 May 3 02:10 fade.gif
drwxrwxr-x 4 nobu nobu 4096 Jun 27 02:38 fullstack
drwxrwxr-x 11 nobu nobu 4096 Jul 12 16:21 gym
drwxr-xr-x 2 nobu nobu 4096 Sep 17 15:37 hackerdirectory
drwx------ 2 nobu nobu 4096 May 3 03:18 hts-cache
-rw-rw-r-- 1 nobu nobu 2101 May 3 03:18 hts-log.txt
drwxr-xr-x 6 nobu nobu 4096 Sep 4 23:27 locust_k8s
drwxr-xr-x 10 nobu nobu 4096 Aug 28 11:44 mecab-ipadic-neologd
drwxr-xr-x 2 nobu nobu 4096 Mar 20 06:52 Music
drwxr-xr-x 14 nobu nobu 4096 Aug 24 14:10 myapp
drwx------ 3 nobu nobu 4096 Mar 30 03:28 openvpn-ca
drwxr-xr-x 4 nobu nobu 4096 Aug 19 19:47 Pictures
drwxr-xr-x 2 nobu nobu 4096 Mar 20 06:52 Public
drwxr-xr-x 3 nobu nobu 4096 Aug 15 12:34 repos
drwxr-xr-x 6 nobu nobu 4096 Sep 4 23:23 snap
drwxr-xr-x 2 nobu nobu 4096 Mar 20 06:52 Templates
-rw-rw-r-- 1 nobu nobu 5477405 Jul 5 08:17 tf
-rwxrwxr-x 1 nobu nobu 4474932 Oct 24 2017 unetbootin-linux-latest
drwxr-xr-x 3 nobu nobu 4096 Apr 27 11:56 Videos
drwx------ 3 nobu nobu 4096 Jun 27 02:46 'VirtualBox VMs'
drwxrwxr-x 5 nobu nobu 4096 May 3 02:36 websites
drwxrwxr-x 2 nobu nobu 4096 Jul 9 21:15 work
Now I did:
nobu#nobu-ThinkPad-T420:~$ locate hackedfile
nobu#nobu-ThinkPad-T420:~$ whereis hackedfile
hackedfile:
What does this mean? I've tried sudo su then ls but still can't see it.
Edit: So I found it per the commands below but can't get rid of it.
nobu#nobu-ThinkPad-T420:~$ sudo find /root -type f -name hackedfile
/root/hackedfile
nobu#nobu-ThinkPad-T420:~$ sudo rm /root/hackedfile
nobu#nobu-ThinkPad-T420:~$ sudo find /root -type f -name hackedfile
nobu#nobu-ThinkPad-T420:~$ whereis hackedfile
hackedfile:
Edit (not listed)
nobu#nobu-ThinkPad-T420:~$ sudo ls -al /root
total 64
drwx------ 12 root root 4096 Sep 17 16:23 .
drwxr-xr-x 28 root root 4096 Sep 9 12:45 ..
drwx------ 2 root root 4096 Jul 10 07:31 .aptitude
-rw------- 1 root root 1124 Sep 17 16:30 .bash_history
-rw-r--r-- 1 root root 3106 Oct 23 2015 .bashrc
drwx------ 4 root root 4096 Apr 11 05:47 .cache
drwx------ 7 root root 4096 Apr 11 15:54 .config
drwx------ 3 root root 4096 Mar 22 02:47 .dbus
drwx------ 3 root root 4096 Apr 11 12:23 .gnupg
drwxr-xr-x 4 root root 4096 Aug 17 09:20 .java
drwxr-xr-x 3 root root 4096 Apr 1 08:12 .local
drwxr-xr-x 2 root root 4096 Mar 30 02:55 .nano
drwxr-xr-x 2 root root 4096 Aug 21 11:13 .oracle_jre_usage
-rw-r--r-- 1 root root 148 Aug 18 2015 .profile
drwx------ 2 root root 4096 Sep 4 22:58 .ssh
-rw-r--r-- 1 root root 220 Aug 8 14:02 .wget-hsts
Edit (when sudo su)
root#nobu-ThinkPad-T420:/home/nobu# whereis hackedfile
hackedfile:
So when I do command whereis, it shows the file. So is it really deleted?
But now when I try: sudo find /root -type f -name hackedfile I get:
nobu#nobu-ThinkPad-T420:~$ sudo find /root -type f -name hackedfile
nobu#nobu-ThinkPad-T420:~$
And thus it seems to be gone except doing `whereis' still shows it with the colon.
Edit:
Beware that whereis returns whatever you were looking for say filename: and then lists the PATH of location after colon.
So here is how to use find:
find
That's from my textbook listed above.
Try pwd to see where you are in the file system. You will probably find the file using sudo ls -al /root

Manually install Emacs feature

I have a question about Emacs customisation.
For example, there is a git repo like https://github.com/bbatsov/projectile.
The directory structure is like:
-rw-r--r-- 1 haoruan staff 12K Nov 7 16:30 CHANGELOG.md
-rw-r--r-- 1 haoruan staff 1.5K Nov 7 16:30 CONTRIBUTING.md
-rw-r--r-- 1 haoruan staff 138B Nov 7 16:30 Cask
-rw-r--r-- 1 haoruan staff 884B Nov 7 16:30 Makefile
-rw-r--r-- 1 haoruan staff 28K Nov 7 16:30 README.md
-rw-r--r-- 1 haoruan staff 39K Nov 7 16:30 helm-projectile.el
-rw-r--r-- 1 haoruan staff 4.4K Nov 7 16:30 persp-projectile.el
-rw-r--r-- 1 haoruan staff 112K Nov 7 16:30 projectile.el
drwxr-xr-x 7 haoruan staff 238B Nov 7 16:30 screenshots
drwxr-xr-x 3 haoruan staff 102B Nov 7 16:30 script
drwxr-xr-x 7 haoruan staff 238B Nov 7 16:30 test
drwxr-xr-x 3 haoruan staff 102B Nov 7 16:30 travis
It is suggested that the recommended way to install this feature is using MELPA. I can clone this git repo, but I can not ping MELPA. My question is how can I manually install this Emacs feature? More generic, how can I manually install such a Emacs feature which is using cask?
In your example,you dose not need cask
git clone https://github.com/bbatsov/projectile /some/place/you/want
Then add
(add-to-load-path "/some/place/you/want")
in your .emacs or init.el.Then
(require 'projectile)
manually.

how include pandas library on my python package?

I have to include the pandas library in my package to run my software on a cluster server without pandas library installed but with all the right dependencies.
I tried to build on my pc the pandas library from source (ver. 0.8.1):
python setup.py build_ext --inplace
and if I move the builded pandas folder anywhere in some other folder in my pc I can import it in my software (ex ./mySoftwareFolder/pandas)
But when I move my software with pandas libray on the cluster server it raise me the error:
File "testPandas.py", line 9, in <module>
import pandas
File "/home/TEST/pandas/__init__.py", line 15, in <module>
raise ImportError('C extensions not built: if you installed already '
ImportError: C extensions not built: if you installed already verify that you are not importing from the source directory
like if it is not compiled.
What is wrong in my way to include library?
thanks a lot!
update:
the directory that I copy to cluster server contains:
-bash-4.2$ ll -a pandas
totale 11476
drwxr-xr-x. 14 francesco dottor 4096 1 set 13.37 .
drwxr-xr-x. 10 francesco dottor 8192 1 set 13.36 ..
-rwxr-xr-x. 1 francesco dottor 2648299 1 set 13.36 _algos.so
drwxr-xr-x. 2 francesco dottor 4096 1 set 13.36 compat
drwxr-xr-x. 2 francesco dottor 4096 1 set 13.36 core
-rw-r--r--. 1 francesco dottor 394 1 set 13.36 info.py
-rw-r--r--. 1 francesco dottor 557 1 set 13.36 info.pyc
-rw-r--r--. 1 francesco dottor 1269 1 set 13.36 __init__.py
-rw-r--r--. 1 francesco dottor 1643 1 set 13.37 __init__.pyc
drwxr-xr-x. 3 francesco dottor 4096 1 set 13.36 io
-rwxr-xr-x. 1 francesco dottor 7437108 1 set 13.36 lib.so
-rwxr-xr-x. 1 francesco dottor 474199 1 set 13.36 _period.so
drwxr-xr-x. 2 francesco dottor 4096 1 set 13.36 rpy
drwxr-xr-x. 3 francesco dottor 4096 1 set 13.36 sandbox
-rw-r--r--. 1 francesco dottor 844 1 set 13.36 setup.py
drwxr-xr-x. 3 francesco dottor 4096 1 set 13.36 sparse
-rwxr-xr-x. 1 francesco dottor 1065313 1 set 13.36 _sparse.so
drwxr-xr-x. 3 francesco dottor 4096 1 set 13.36 src
drwxr-xr-x. 3 francesco dottor 4096 1 set 13.36 stats
drwxr-xr-x. 3 francesco dottor 4096 1 set 13.36 tests
drwxr-xr-x. 3 francesco dottor 4096 1 set 13.36 tools
drwxr-xr-x. 3 francesco dottor 4096 1 set 13.36 tseries
drwxr-xr-x. 2 francesco dottor 4096 1 set 13.36 util
-rw-r--r--. 1 francesco dottor 42 1 set 13.36 version.py
-rw-r--r--. 1 francesco dottor 204 1 set 13.36 version.pyc
What platform are you building the C extensions on? On the cluster machine, verify that the extension shared objects (.so files on Linux/OSX and .pyd files on Windows) are in the folder you copied:
08:21 ~/code/pandas/pandas $ ll
total 12568
-rw-r--r-- 1 wesm staff 1269 Aug 25 04:49 __init__.py
-rw-r--r-- 1 wesm staff 1645 Aug 25 04:52 __init__.pyc
-rwxr-xr-x 1 wesm staff 799464 Aug 25 04:50 _algos.so
-rwxr-xr-x 1 wesm staff 65712 Aug 25 04:48 _engines.so
-rwxr-xr-x 1 wesm staff 197056 Sep 1 22:13 _period.so
-rwxr-xr-x 1 wesm staff 341032 Aug 25 04:53 _sparse.so
drwxr-xr-x 6 wesm staff 204 Aug 25 04:52 compat
drwxr-xr-x 44 wesm staff 1496 Sep 1 17:34 core
drwxr-xr-x 3 wesm staff 102 Aug 25 04:49 finance
-rw-r--r-- 1 wesm staff 394 Aug 25 04:49 info.py
-rw-r--r-- 1 wesm staff 535 Aug 25 04:52 info.pyc
drwxr-xr-x 15 wesm staff 510 Sep 1 23:14 io
-rwxr-xr-x 1 wesm staff 2490600 Sep 1 22:13 lib.so
drwxr-xr-x 9 wesm staff 306 Sep 1 17:34 rpy
drwxr-xr-x 6 wesm staff 204 May 20 19:13 sandbox
-rw-r--r-- 1 wesm staff 844 Feb 22 2012 setup.py
drwxr-xr-x 17 wesm staff 578 Aug 25 04:52 sparse
drwxr-xr-x 55 wesm staff 1870 Sep 1 22:57 src
drwxr-xr-x 23 wesm staff 782 Aug 25 04:52 stats
drwxr-xr-x 40 wesm staff 1360 Sep 1 17:34 tests
drwxr-xr-x 16 wesm staff 544 Aug 25 04:52 tools
drwxr-xr-x 28 wesm staff 952 Sep 1 17:34 tseries
drwxr-xr-x 18 wesm staff 612 Aug 25 04:52 util
-rw-r--r-- 1 wesm staff 54 Sep 1 22:57 version.py
-rw-r--r-- 1 wesm staff 204 Sep 1 22:58 version.pyc