Skip to content

Instantly share code, notes, and snippets.

Oleg Smedyuk conformist-mw

Block or report user

Report or block conformist-mw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View vimtips.txt
# search pattern and hide all other lines
:vimgrep /something/g % | copen
@conformist-mw
conformist-mw / less-highlight.sh
Created Mar 29, 2017
added highlights to less
View less-highlight.sh
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
View cron-help.sh
# +---------------- 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
The old rounding behaviour
View py3_round.py
def my_round(x):
return int(x + math.copysign(0.5, x))
View contacts_vcf_splitter.py
# 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:
View 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
View 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
View usefull_commands.sh
# gen password without dependencies, 25 symbols
$ head -c16 /dev/urandom | base64
View telegram_tunnel.sh
#!/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 Jul 23, 2018 — forked from joaopizani/.screenrc
A killer GNU Screen Config
View .screenrc
# 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
You can’t perform that action at this time.