Skip to content

Instantly share code, notes, and snippets.

# search pattern and hide all other lines
:vimgrep /something/g % | copen
@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
# +---------------- 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 / 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))
# 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:
#!/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
# gen password without dependencies, 25 symbols
$ head -c16 /dev/urandom | base64
#!/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...
@conformist-mw
conformist-mw / .screenrc
Last active July 23, 2018 13:24 — forked from joaopizani/.screenrc
A killer GNU Screen Config
# 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