The Daily Awesome Blog Thoughts, stories and ideas.

SVN Primer

st - svn status - looks up current directory and sub-directories for changed files/new files

  1. svn add file_path - only for new files
  2. svn st - status changes
  3. svn commit file_path -m “message about the change” - files separated by a space or directories
  4. Difference of working copy (HEAD) and revision # 25719 (Revision # can be obtained from svn log | less) svn diff footer.comp -r 25719:HEAD check log changes svn log | less show modified files svn log -v | less less - goes by line more - goes by page
  5. revert file svn cat filepath -r28963 > filepath
  6. Review code svn diff | vim - -R or better add it to .bashrc: alias sd=’svn diff | vim - -R

Serious Vulnerability in SSH Client

https://maclemon.at/blog/2016/01/14/fixing-openssh-cve-2016-0777/

You don’t need to read this all. Just follow these two steps.

home-brew.png

Homebrew

brew update
brew install homebrew/dupes/openssh

MacPorts

port selfupdate
port install openssh

After installation you must see openssh-7.1p2 where p2 means patch that fixes problem.

If you have problem with homebrew or MacPorts, please run this

echo -e 'Host *\nUseRoaming no' >> /etc/ssh_config

or add manually Roaming no line after very first Host * you can find at /etc/ssh_config on your Mac.

After update double check version of ssh

ssh -V

For those who still have older version than OpenSSH_7.1p2, OpenSSL 1.0.2e 3 Dec 2015 please apply this patch

sudo ls -l /usr/local/bin/ssh && sudo mv /usr/bin/ssh /usr/bin/ssh.bak && sudo ln -s /usr/local/bin/ssh /usr/bin/ssh

Shell Primer

Ctrl + C - keyboard interrupt
Ctrl + D - disconnect, close shell

jobs - list of process


Tougle between vi and shell
Ctrl + Z - suspends 
bg - continue process
fg - get back into the

:sh
Ctrl +D

  sudo apt-get install gt5
  disk usage
 find / -size +10M -ls

free - free memory
uptime

du -h media/ - size of a folder

find . -name ".htaccess" -print

grep -sr 'text' .


Grep a file, show several surrounding lines:
-B num to set how many lines before the match
-A num for the number of lines after the match
grep -B 3 -A 2 foo README.txt

Grep by file type
grep -r -i --include \*.h

scp helloworld.zip user@vivawebsolutions.com:/home/content/07/5607462/html/

strip 3 leading directories
tar -xvf ../dev-store.tar --strip-components=3


ls -l    list files
h - compresses kilobytes

touch filename      creates empty file if not exists, updates last modified date

ls -lh
total 16K
-rw-rw-r-- 1 vlad vlad  762 Sep 17 16:40 hour0.txt

chmod 777 filename      changing permissions
each digit corresponds to user, group, other
r-w-x each has a bit, summup to get a permission #
1-1-1 => 7 (permission to read, write, and execute)
1-1-0 => 6 (permission to read and write)
1-0-0 => 4 (permission to read)

chmod u=rw,g=r,o=r filename
chmod 644 filename

id      list groups that user is part of

history | grep ssh      view shell history

!757    run command from history #757

!757:p  view command from history #757

!!      run last command

SCP - Secure Copy

  1. remote server to computer scp admin@hostname:foo foo that copies file from $home/foo on the server to curent dir (./foo)

  2. computer to remote server scp foo admin@hostname:bar that copies file from ./foo to the server $home/bar

Sass Maps