Skip to content

Instantly share code, notes, and snippets.

#!/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...
# gen password without dependencies, 25 symbols
$ head -c16 /dev/urandom | base64
#!/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
#!/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 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:
@conformist-mw
conformist-mw / py3_round.py
Created May 1, 2017 20:23
The old rounding behaviour
def my_round(x):
return int(x + math.copysign(0.5, x))
# +---------------- 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
@conformist-mw
conformist-mw / less-highlight.sh
Created March 29, 2017 09:09
added highlights to less
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
# search pattern and hide all other lines
:vimgrep /something/g % | copen