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
@conformist-mw
conformist-mw / git-aliases.md
Last active Aug 18, 2018 — forked from mwhite/git-aliases.md
The Ultimate Git Alias Setup
View git-aliases.md

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@conformist-mw
conformist-mw / python-on-ubuntu.sh
Created Jul 27, 2018 — forked from neuroticnerd/python-on-ubuntu.sh
Python 2.7.9 on Ubuntu 14.04.2 (without overwriting original version)
View python-on-ubuntu.sh
#! /usr/bin/env bash
# http://smirnov-am.blogspot.com/2015/04/installation-of-python-279-in-ubuntu.html
# http://davebehnke.com/python-pyenv-ubuntu.html
# https://renoirboulanger.com/blog/2015/04/upgrade-python-2-7-9-ubuntu-14-04-lts-making-deb-package/
# install dependencies
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
@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
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...
View usefull_commands.sh
# gen password without dependencies, 25 symbols
$ head -c16 /dev/urandom | base64
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 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:
@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 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
You can’t perform that action at this time.