PuTTY ssh confing

Spread the love

I love tricks and lifehacks. Every time I am glad when I manage to simplify the next routine operation. And since I have been working as a web programmer for 8 years now, I have programmer routine operations and life hacks. This is what I want to share with you.

Some of the tricks before me have already been described in Habré, some I took from other sources, some I invented myself. I would be grateful if in the comments to the post you write what tricks you use.

Using ** in zsh

Thus, I look for files in a folder by extension recursively:

ls ** / *. json

Files larger than 1 megabyte:

ls -lh ** / * (Lm + 1)

Quickly and confidently remove garbage from the repository in the python project and convulsively rule. gitignore:

git rm —cached ** / *. pyc

Generation. gitignore using the gitgnore service. io

First new team

git config —global alias.ignore ‘! gi () {curl -L -s https://www.gitignore.io/api/$@;}; gi ‘

and now we can generate our own file. And no more pyc files!

git ignore sass, node, python, django

Windows users are a bit more complicated.

Oh-my-zsh on windows

If you do not want to read the section from the previous trick about Windows for reasons not related to the use of other operating systems, then for you I have a pleasant surprise.

Babun is quite a decent implementation of a terminal emulator. Of the benefits: integration with oh-my-zsh and package manager.

Parsing bash expressions using the service hehell.com

Very often I use this service. I can not remember the meaning of flags. The service can explain what it is like, for example:

for user in $ (cut -f1 -d: / etc / passwd); do crontab -u $ user -l 2> / dev / null; done

Quick start web server from console

To start the web server with the root of the current folder:

python -m SimpleHTTPServer 8000

or install BrowserSync

npm i -g browser-sync && browser-sync start —server

PHP also works

php -S

and ruby:

ruby -run -e httpd – -p 5000.

and for lovers:

C: \> “C: \ Program Files (x86) \ IIS Express \ iisexpress.exe” / path: C: \ MyWeb / port: 8000