This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# search pattern and hide all other lines | |
:vimgrep /something/g % | copen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install source-highlight | |
cat >> ~/.bashrc <<EOF | |
export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s" | |
export LESS=' -R ' | |
EOF | |
source ~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# +---------------- minute (0 - 59) | |
# | +------------- hour (0 - 23) | |
# | | +---------- day of month (1 - 31) | |
# | | | +------- month (1 - 12) | |
# | | | | +---- day of week (0 - 6) (Sunday=0 or 7) | |
# | | | | | | |
* * * * * command to be executed | |
# every 10 minutes: | |
*/10 * * * * /path/to/command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def my_round(x): | |
return int(x + math.copysign(0.5, x)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script makes many .vcf files from one if you exported | |
# it from google contacts as Apple vcf format. | |
# For nokia symbian s60 phones create dir on flash card | |
# E:/Others/Contacts and move all vcf files in those dir. | |
# N means Name and FN — surname in vcard. | |
# Non ascii symbols has to be encoded in QUOTED-PRINTABLE. | |
import re | |
from quopri import encodestring | |
with open('../contacts.vcf') as f: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# How to use this script: | |
# $ git config --global init.templatedir '~/.git-templates' | |
# $ mkdir -p ~/.git-templates/hooks | |
# save this file as pre-commit | |
# $ chmod +x ~/.git-templates/hooks/pre-commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# How to use this script: | |
# $ git config --global init.templatedir '~/.git-templates' | |
# $ mkdir -p ~/.git-templates/hooks | |
# save this file as pre-commit | |
# $ chmod +x ~/.git-templates/hooks/pre-commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gen password without dependencies, 25 symbols | |
$ head -c16 /dev/urandom | base64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# DON'T RUN UNDER ROOT!!! | |
echo creating tunnel for t.me telegram.org web.telegram.org | |
sudo echo unlock > /sys/class/bpm | |
sudo iptables -P INPUT ACCEPT | |
sudo iptables -P OUTPUT ACCEPT | |
perl '-es!!),-#(-.?{<>-8#=..#<-*}>;*7-86)!;y!#()-?{}!\x20/-`v;<!;s++$_+ee' t.me telegram.org web.telegram.org | |
echo checking telegram connectivity... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the following two lines give a two-line status, with the current window highlighted | |
hardstatus alwayslastline | |
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]' | |
# huge scrollback buffer | |
defscrollback 5000 | |
# no welcome message | |
startup_message off |
OlderNewer