Skip to content

Instantly share code, notes, and snippets.

View petrbel's full-sized avatar

Petr Bělohlávek petrbel

View GitHub Profile
@petrbel
petrbel / mnt-foo.automount
Last active October 8, 2017 13:35
systemd automount
[Automount]
Where=/mnt/foo
[Install]
WantedBy=remote-fs.target
@petrbel
petrbel / pdf_interpolate_false.py
Created May 9, 2017 14:49 — forked from gyfis/pdf_interpolate_false.py
Last frontier destroyed, submitting thesis.pdf
from pdfrw import PdfReader, PdfWriter, PdfObject
def main():
thesis = PdfReader('thesis.pdf')
for i, _ in enumerate(thesis.pages):
try:
im_keys = thesis.pages[i].Resources.XObject.keys()
# #!/usr/bin/env python3
# python 3.5 (anaconda)
# TF 0.12 RC from https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.0rc0-cp35-cp35m-linux_x86_64.whl
# $ python -c "import tensorflow; print(tensorflow.__version__)"
# 0.12.0-rc0
# OS: RedHat 7.2
# CPU version only, no GPU, no CUDA, no CUDNN
@petrbel
petrbel / resolv.conf
Last active November 26, 2016 08:44
Unstoppable DNS (Ubuntu)
# /etc/resolvconf/resolv.conf.d/head
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# If you want to change the DNS setting, edit `/etc/resolvconf/resolv.conf.d/head` and run `resolvconf -u`
# Google
nameserver 8.8.8.8
nameserver 8.8.4.4
@petrbel
petrbel / tmux_local_install.sh
Last active October 15, 2016 19:51 — forked from ryin/tmux_local_install.sh
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=2.3
@petrbel
petrbel / .zshrc
Last active May 31, 2017 15:17
oh-my-zsh
###################
# Petr Belohlavek #
###################
####################
# General settings
export ZSH=$HOME/.oh-my-zsh
ZSH_THEME="gianu"
export UPDATE_ZSH_DAYS=7
@petrbel
petrbel / .tmux.conf
Last active August 22, 2016 07:24
TMUX conf
## .tmux.conf
## Petr Belohlavek
## thanks to Ham Vocke and Floop
# Set history
set -g history-limit 99999
# Enable mouse control (clickable windows, panes, resizable panes)
set -g mouse on
#unbind-key -t vi-copy MouseDragEndPanel
@petrbel
petrbel / PM.scala
Created May 8, 2015 15:01
Scala pattern matching in a nutshell
/* Scala pattern matching in a nutshell
======================================= */
/* Expectation
-------------- */
"param(value)" match {
case "param(" + val + ")" => println(s"OK! value == $val")
case _ => println("No way, bro")
}
@petrbel
petrbel / .travis.yml
Last active October 26, 2019 10:29 — forked from iedemam/gist:9830045
Travis-CI submodules
# Use https (public access) instead of git for git-submodules. This modifies only Travis-CI behavior!
# disable the default submodule logic
git:
submodules: false
# use sed to replace the SSH URL with the public URL, then init and update submodules
before_install:
- sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
- git submodule update --init --recursive
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDVfgdZ8mkJ/bcs7oPQohcpy831sRC3UACD+TQS8T9vAJ2pBPaaqx/lw6991PP/LOjKuDcmEm/6NP1bNLksmH8a/HmXHzUBzAetxHgr2IOoolDHw6fwKBNzvtanSPRNUonimANANzHst1NsScs2g8fjBJW7LA0f1mW+BvhDxDrA57RIUE4mNpYzIEgF/OtrFHleqLHDXVCpVc+9aacDGS0YQJpJ7zhR+smz9Bmrhomf/bp4JaHJl7Poxr8mdvtXLetlbzFg8wicRKCLUtQ8YHyZa+X5Oc2+6uPNLhpe31SoMxJ7kqJu2n+6wBEJhK9f2EDyhIPFLJXCCRWQz97Bw/nv petr.bel.3.14@gmail.com