Skip to content

Instantly share code, notes, and snippets.

# git-cd needs to be a shell function to be able to change directory
# on the other hand this means that it can't be invoked by 'git cd' command
git-cd()
{
# try to get root directory of git repo, exit if no repo found
if ! GIT_ROOT=$(git rev-parse --show-toplevel); then
return 1
fi
if [[ $# = 0 ]]; then
# no arguments, cd right into the repo root
@marbu
marbu / upcbroadband_check
Created July 12, 2015 13:44
upc-broadband-check
213.220.224.0 ip-213-220-224-0.net.upcbroadband.cz.
213.220.224.1 ip-213-220-224-1.net.upcbroadband.cz.
213.220.224.2 ip-213-220-224-2.net.upcbroadband.cz.
213.220.224.3 ip-213-220-224-3.net.upcbroadband.cz.
213.220.224.4 ip-213-220-224-4.net.upcbroadband.cz.
213.220.224.5 ip-213-220-224-5.net.upcbroadband.cz.
213.220.224.6 ip-213-220-224-6.net.upcbroadband.cz.
213.220.224.7 ip-213-220-224-7.net.upcbroadband.cz.
213.220.224.8 ip-213-220-224-8.net.upcbroadband.cz.
213.220.224.9 ip-213-220-224-9.net.upcbroadband.cz.
@marbu
marbu / xprofile.md
Created September 13, 2015 17:40
searching for xprofile

xprofile file

Raw notes about ~/.xprofile script.

Upstream

Upstream DM which executes ~/.xprofile file in Xsession script:

  • GDM (Gnome): see Xsession.in
  • KDM (KDE 4): see genkdmconf.c
@marbu
marbu / no-site-packages
Last active December 13, 2015 15:27
pyp2rpm-virtualenv-issues
$ cd ~/projects/pyp2rpm
$ virtualenv-3.4 .env
Using base prefix '/usr'
New python executable in .env/bin/python3
Also creating executable in .env/bin/python
Installing setuptools, pip...done.
$ source .env/bin/activate
$ python setup.py install
warning: no previously-included files found matching '_pytest/impl'
warning: no previously-included files matching '*.pyc' found under directory '*'
$ host portal.statnipokladna.cz
portal.statnipokladna.cz has address 5.145.105.1
portal.statnipokladna.cz has IPv6 address 2001:b80:102:2c0:dead:face:591:6901
https://www.youtube.com/watch?v=kI-KpfQFgug # python coroutines
https://www.youtube.com/watch?v=M_ns_vIshmw # gnu radio
https://www.youtube.com/watch?v=t-TwCLwYIGE # Apache HTrace
https://www.youtube.com/watch?v=aieG8gjpqsw # gimp tricks
https://www.youtube.com/watch?v=jWM3HTwsNE8 # glusterfs @ facebook
https://www.youtube.com/watch?v=4NG1ngz0nnY # BTR'ed ZFS
https://www.youtube.com/watch?v=zkHkrSVHTjA # btrfs dedup
https://www.youtube.com/watch?v=jr4zQc3g1Ts # terryble git ideas
https://www.youtube.com/watch?v=Snr44e7Fjgw # QEMU/libvirt
https://www.youtube.com/watch?v=X1NAJbLqEv8 # SELinux
In [20]: for node in nodetree.traverse(lambda node: isinstance(node, nodes.title)):
    print(node.line)
   ....:     
6
11
In [21]: list(zip(range(1,100), docstring.split("\n")))
@marbu
marbu / gpgmutt.md
Created March 19, 2017 12:07 — forked from bnagy/gpgmutt.md
Mutt, Gmail and GPG

GPG / Mutt / Gmail

About

This is a collection of snippets, not a comprehensive guide. I suggest you start with Operational PGP.

Here is an incomplete list of things that are different from other approaches:

  • I don't use keyservers. Ever.
  • Yes, I use Gmail instead of some bespoke hipster freedom service
@marbu
marbu / muttrc
Created March 19, 2017 13:07
mutt config
#
# General
#
set send_charset = "us-ascii:utf-8"
set signature = "~/.mutt/sig"
set sort = threads
# Color scheme
source ~/.mutt/colors.foobar