I've tried to use vim-gitgutter but it doesn't work and I even don't know where to find a root of error.
$ git --version
git version 1.9.3 (Apple Git-50)
$ vim --version | head -1
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 12 2013 14:04:26)
$ ll ~/.vim/autoload/pathogen.vim
-rw-r--r-- 1 coder staff 12K 8 Dec 23:32 /Users/coder/.vim/autoload/pathogen.vim
$ ll ~/.vim/bundle/vim-gitgutter
total 56
-rw-r--r-- 1 coder staff 12K 8 Dec 23:17 README.mkd
drwxr-xr-x 4 coder staff 136B 8 Dec 23:17 autoload
drwxr-xr-x 3 coder staff 102B 8 Dec 23:17 doc
drwxr-xr-x 3 coder staff 102B 8 Dec 23:17 plugin
-rw-r--r-- 1 coder staff 16K 8 Dec 23:17 screenshot.png
drwxr-xr-x 39 coder staff 1,3K 8 Dec 23:17 test
:echo has('signs') returns 1 as it should and I can see the differences by git diff
It turned out that pathogen wasn't activated and it didn't load gitgutter. I fixed it by adding the following line to ~/.vimrc
execute pathogen#infect()
Related
I am running Visual Studio Code Version 1.19.3 on Linux Mint 18.3. When I try to execute binaries that I can clearly see and run in my external terminal, they cannot be found. When I 'ls' /usr/bin from the integrated terminal, many files are missing and others are different versions.
External bash /usr/bin ls snippet:
-rwxr-xr-x 1 root root 10392 Jan 30 2016 pgmtolispm
-rwxr-xr-x 1 root root 17048 Jan 30 2016 pgmtopbm
-rwxr-xr-x 1 root root 10392 Jan 30 2016 pgmtoppm
-rwxr-xr-x 1 root root 27280 Nov 21 2016 pgrep
lrwxrwxrwx 1 root root 22 Jan 15 21:29 phar -> /etc/alternatives/phar
lrwxrwxrwx 1 root root 12 Aug 9 10:43 phar7.0 -> phar.phar7.0
lrwxrwxrwx 1 root root 27 Jan 15 21:29 phar.phar -> /etc/alternatives/phar.phar
-rwxr-xr-x 1 root root 14826 Aug 9 10:42 phar.phar7.0
lrwxrwxrwx 1 root root 21 Jan 15 21:29 php -> /etc/alternatives/php
-rwxr-xr-x 1 root root 4430896 Aug 9 10:43 php7.0
-rwxr-xr-x 1 root root 6264 Jan 30 2016 pi1toppm
-rwxr-xr-x 1 root root 10384 Jan 30 2016 pi3topbm
-rwxr-xr-x 1 root root 200736 Jan 29 2016 pic
Integrated terminal /usr/bin ls snippet:
-rwxr-xr-x 3 nfsnobody nfsnobody 45393 Dec 31 1969 perlthanks
-rwxr-xr-x 2 nfsnobody nfsnobody 14408 Dec 31 1969 pfbtops
-rwxr-xr-x 2 nfsnobody nfsnobody 38896 Dec 31 1969 pg
-rwxr-xr-x 3 nfsnobody nfsnobody 26680 Dec 31 1969 pgrep
-rwxr-xr-x 2 nfsnobody nfsnobody 200696 Dec 31 1969 pic
Is VSC creating some kind of virtual filesystem for the terminal that has its own /usr/bin, but still attaches my working folder in the right path? I am lost and it is preventing me from being able to use the Google debugger and PHP Intellisense, just to name a couple of things.
I have installed homebrew without any problems.
The problem was to install node.. I got permission errors about /usr/local directory and symlinks.
So I did
sudo chown -R myuser /usr/local
then I istalled node without problems and then I did
sudo chown -R root /usr/local
I don't remember how was the owners in first place. I just followed some suggestions from stackoverflow to change the owner of /usr/local (a voice inside me says I did bad).
So when I run
brew doctor
I got some warnings and suggestions to chown some folders in /usr/local directory, so I did them. Then when I run
brew doctor
brew update
I get no warnings or errors anymore and looks fine (there was no updates to do after all).
My directories now looks like below. Can anyone confirm if is secure like that? How should be the owners in /usr/local ? Tt's okay to have it owned by my user as they say at github? Thanks.
myuser#iMac:/usr$ ls -la
total 8
drwxr-xr-x# 12 root wheel 408B Sep 30 23:52 ./
drwxr-xr-x 30 root wheel 1.1K Jan 23 17:51 ../
drwxr-xr-x 5 root wheel 170B Aug 23 03:51 X11/
lrwxr-xr-x 1 root wheel 3B Sep 30 23:43 X11R6# -> X11
drwxr-xr-x 3 root wheel 102B Aug 27 04:17 adic/
drwxr-xr-x 1055 root wheel 35K Jan 23 17:51 bin/
drwxr-xr-x 263 root wheel 8.7K Jan 23 17:52 lib/
drwxr-xr-x 186 root wheel 6.2K Jan 23 17:51 libexec/
drwxrwxr-x 22 root admin 748B Feb 7 12:28 local/
drwxr-xr-x 243 root wheel 8.1K Jan 23 17:51 sbin/
drwxr-xr-x 45 root wheel 1.5K Sep 30 23:43 share/
drwxr-xr-x 4 root wheel 136B Sep 17 09:03 standalone/
myuser#iMac:/usr$ cd local/
myuser#iMac:/usr/local$ ls -la
total 104
drwxrwxr-x 22 root admin 748B Feb 7 12:28 ./
drwxr-xr-x# 12 root wheel 408B Sep 30 23:52 ../
drwxr-xr-x 15 myuser admin 510B Feb 7 12:56 .git/
-rw-r--r-- 1 root admin 847B Feb 6 10:48 .gitignore
-rw-r--r-- 1 root admin 1.3K Feb 6 10:48 .travis.yml
-rw-r--r-- 1 root admin 291B Feb 6 10:48 .yardopts
-rw-r--r-- 1 root admin 3.1K Feb 6 10:48 CODEOFCONDUCT.md
-rw-r--r-- 1 root admin 2.5K Feb 6 10:48 CONTRIBUTING.md
drwxr-xr-x 3 myuser admin 102B Feb 7 12:28 Cellar/
-rw-r--r-- 1 root admin 1.2K Feb 6 10:48 LICENSE.txt
drwxr-xr-x 10 myuser admin 340B Feb 7 12:28 Library/
-rw-r--r-- 1 root admin 2.4K Feb 6 10:48 README.md
-rw-r--r-- 1 root admin 23K Feb 6 10:48 SUPPORTERS.md
drwxrwxr-x 9 root admin 306B Feb 7 12:28 bin/
drwxr-xr-x 3 myuser admin 102B Feb 7 12:28 etc/
drwxr-xr-x 10 root wheel 340B Aug 3 2015 git/
drwxr-xr-x 20 root wheel 680B Dec 3 02:01 go/
drwxr-xr-x 3 myuser admin 102B Feb 7 12:28 include/
drwxr-xr-x 4 myuser admin 136B Feb 7 12:28 lib/
drwxr-xr-x 3 root wheel 102B May 15 2015 n/
drwxr-xr-x 3 myuser admin 102B Feb 7 12:28 opt/
drwxrwxr-x 5 root admin 170B Feb 7 12:28 share/
myuser#iMac:/usr/local$
I am trying to obtain a backup of 'newly' added files to a Fedora system. Files can be copied through a Windows Samba share and appear to retain the original created timestamp. However, because it retains this timestamp I am having issues identifying which files were newly added to the system.
Currently, the only way I can think of doing this is to have a master list snapshot of all the files on the system at a specific time. Then when I perform the backup I compare the previous snapshot with a current snapshot. It would detect files that were removed from the system but it seems excessive and I was thinking there must be an easier way to backup newly added files.
Terry
Try using find. Something like this:
find . -ctime -10
That will give you a list of files and directories, starting from within your current directory, that has had its state changed within the last 10 days.
Example:
My Downloads directory looks like this:
kobus#akira:~/Downloads$ ll
total 2025284
drwxr-xr-x 4 kobus kobus 4096 Nov 4 11:25 ./
drwxr-xr-x 41 kobus kobus 4096 Oct 30 09:26 ../
-rw-rw-r-- 1 kobus kobus 8042383 Oct 28 14:08 apache-maven-3.3.3- bin.tar.gz
drwxrwxr-x 2 kobus kobus 4096 Oct 14 09:55 ELKImages/
-rw-rw-r-- 1 kobus kobus 1469054976 Nov 4 11:25 Fedora-Live-Workstation-x86_64-23-10.iso
-rw------- 1 kobus kobus 351004 Sep 21 14:07 GrokConstructor-master.zip
drwxrwxr-x 11 kobus kobus 4096 Jul 11 2014 jboss-eap-6.3/
-rw-rw-r-- 1 kobus kobus 183399393 Oct 19 16:26 jboss-eap-6.3.0-installer.jar
-rw-rw-r-- 1 kobus kobus 158177216 Oct 19 16:26 jboss-eap-6.3.0.zip
-rw-rw-r-- 1 kobus kobus 71680110 Oct 13 13:51 jre-8u60-linux-x64.tar.gz
-rw-r--r-- 1 kobus kobus 4680 Oct 12 12:34 nginx-release-centos-7-0.el7.ngx.noarch.rpm
-rw-r--r-- 1 kobus kobus 3479765 Oct 12 14:22 ngx_openresty-1.9.3.1.tar.gz
-rw------- 1 kobus kobus 16874455 Sep 15 16:49 Oracle_VM_VirtualBox_Extension_Pack-5.0.4-102546.vbox-extpack
-rw-r--r-- 1 kobus kobus 7505310 Oct 6 10:29 sublime_text_3_build_3083_x64.tar.bz2
-rw------- 1 kobus kobus 41467245 Sep 7 10:37 tagspaces-1.12.0-linux64.tar.gz
-rw-rw-r-- 1 kobus kobus 42658300 Nov 4 10:14 tagspaces-2.0.1-linux64.tar.gz
-rw------- 1 kobus kobus 70046668 Sep 15 16:49 VirtualBox-5.0-5.0.4_102546_el7-1.x86_64.rpm
Here's what the find returns:
kobus#akira:~/Downloads$ find . -ctime -10
.
./tagspaces-2.0.1-linux64.tar.gz
./apache-maven-3.3.3-bin.tar.gz
./Fedora-Live-Workstation-x86_64-23-10.iso
kobus#akira:~/Downloads$
Most unices do not have a concept of file creation time. You can't make ls print it because the information is not recorded. If you need creation time, use a version control system: define creation time as the check-in time.
If your unix variant has a creation time, look at its documentation. For example, on Mac OS X (the only example I know of¹), use ls -tU. Windows also stores a creation time, but it's not always exposed to ports of unix utilities, for example Cygwin ls doesn't have an option to show it. The stat utility can show the creation time, called “birth time” in GNU utilities, so under Cygwin you can show files sorted by birth time with stat -c '%W %n' * | sort -k1n.
Note that the ctime (ls -lc) is not the file creation time, it's the inode change time. The inode change time is updated whenever anything about the file changes (contents or metadata) except that the ctime isn't updated when the file is merely read (even if the atime is updated). In particular, the ctime is always more recent than the mtime (file content modification time) unless the mtime has been explicitly set to a date in the future.
"Newly added files, Fedora" : The below examples will show a list with date and time.
Example, all installed packages : $ rpm -qa --last
Example, the latest 100 packages : $ rpm -qa --last | head -100
Example, create a text file : $ rpm -qa --last | head -100 >> last-100-packages.txt
I have clone a git directory as user bob on a remote machine (after having forwarded the local key). When I clone the repo, the repo appears fine and everything shows up including a .git folder.
Now, I want to copy this folder over to another location which happens to be a link to a folder. When I do a cp -r /tmp/tmp.kk3a8xemvr/* /home/staging/myapp, everything gets copied, but not .git folder. When I explicitly call out the .git folder in the cp command, it gets copied. I also noticed the the .gitignore did not get copied either.
Another strange behavior is when I go to /home/staging/myapp, and I do a rm -rf ./*, the .git folder does not get deleted unless I call it out specifically.
How come simple unix commands behave differently for the .git directory? There is nothing special about its permissions. Could it be that the period in front of the file causes some problems?
drwxr-xr-x 8 staging staging 4096 Oct 12 03:42 .git/
My OS is Ubuntu 12.04 LTS.
Linux myapp 3.2.0-54-virtual #82-Ubuntu SMP Tue Sep 10 20:31:18 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
EDIT
Provide more information for Jonathan: I have update the foldernames to match with the commands below:
# cd /tmp/tmp.kk3a8xemvr <- source, everything is good here.
root#myapp1:/tmp/tmp.kk3a8xemvr; ls -la
total 48
drwx------ 9 bob bob 4096 Oct 13 03:08 .
drwxrwxrwt 7 root root 4096 Oct 13 14:55 ..
drwxrwxr-x 3 bob bob 4096 Oct 13 03:08 ansible
drwxrwxr-x 4 bob bob 4096 Oct 13 03:08 backend
drwxrwxr-x 3 bob bob 4096 Oct 13 03:08 clientdb
drwxrwxr-x 15 bob bob 4096 Oct 13 03:08 dapi
drwxrwxr-x 3 bob bob 4096 Oct 13 03:08 docs
drwxrwxr-x 3 bob bob 4096 Oct 13 03:08 fabfile
drwxrwxr-x 8 bob bob 4096 Oct 13 03:08 .git
-rw-rw-r-- 1 bob bob 44 Oct 13 03:08 .gitignore
-rw-rw-r-- 1 bob bob 68 Oct 13 03:08 README.md
-rw-rw-r-- 1 bob bob 450 Oct 13 03:08 requirements.txt
# cd /home/staging; ls
lrwxrwxrwx 1 staging staging 62 Oct 13 03:06 myapp -> /srv/www/staging.myapp.com/public_html/myapp/
# command I use:
sudo cp -r /tmp/tmp.kk3a8xemvr/* /home/staging/myapp
# cd /home/staging/myapp; ls -la; # <- this is the intended destination;
# .git and .gitignore are missing after applying the cp command.
drwxr-xr-x 9 staging staging 4096 Oct 13 14:59 .
drwxr-xr-x 3 staging staging 4096 Oct 13 03:06 ..
drwxr-xr-x 3 staging staging 4096 Oct 13 03:08 ansible
drwxr-xr-x 4 staging staging 4096 Oct 13 03:08 backend
drwxrwxr-x 2 staging staging 4096 Oct 13 14:59 clientdb
drwxr-xr-x 15 staging staging 4096 Oct 13 03:09 dapi
drwxr-xr-x 3 staging staging 4096 Oct 13 03:08 docs
drwxr-xr-x 3 staging staging 4096 Oct 13 03:08 fabfile
-rw-r--r-- 1 staging staging 68 Oct 13 03:08 README.md
-rw-r--r-- 1 staging staging 450 Oct 13 03:08 requirements.txt
If you do:
sudo cp -r /tmp/tmp.kk3a8xemvr/* /home/staging/myapp
the shell expands the * into 'all file or directory names that do not start with .' (thus omitting .git, etc).
If you do:
sudo cp -r /tmp/tmp.kk3a8xemvr /home/staging/myapp
you will get a subdirectory tmp.kk3a8xemvr created in /home/staging/myapp, which is not what you want, I think.
However, if you do:
sudo cp -r /tmp/tmp.kk3a8xemvr/. /home/staging/myapp
you should find you get everything copied where you want it.
I'm having a problem where when I edit a file, it's modified timestamp is set to a time in the future
Illustration of the problem:
$ make
make: Nothing to be done for `all'.
$ touch makefile
$ make
make: Warning: File `makefile' has modification time 19 s in the future
make: Nothing to be done for `all'.
make: warning: Clock skew detected. Your build may be incomplete.
If I edit the file that same thing happens (ie: this is not a problem unique to touch)
More details:
$ date
Thu Jan 24 20:18:19 EST 2013
$ ls -l
total 24
-rw-rw-r--. 1 steve steve 13907 Jan 24 20:18 makefile
-rw-rw-r--. 1 steve steve 23 Jan 24 19:54 modules.mk
drwxrwxr-x. 3 steve steve 4096 Jan 24 19:54 test
$ touch makefile
$ ls -l
total 24
-rw-rw-r--. 1 steve steve 13907 Jan 24 2013 makefile <-- in the future!
-rw-rw-r--. 1 steve steve 23 Jan 24 19:54 modules.mk
drwxrwxr-x. 3 steve steve 4096 Jan 24 19:54 test
$ ls -l
total 24
-rw-rw-r--. 1 steve steve 13907 Jan 24 20:18 makefile
-rw-rw-r--. 1 steve steve 23 Jan 24 19:54 modules.mk
drwxrwxr-x. 3 steve steve 4096 Jan 24 19:54 test
$ date
Thu Jan 24 20:18:48 EST 2013
How can I edit the file and have it's modified time set to now?
I had the same problem a long time ago using NFS. It drove me crazy! The host where the files were stored and my own computer where not syncronized in time. I had to request the system managers to install NTP.