Skip to content

Instantly share code, notes, and snippets.

View wizofe's full-sized avatar
😬
Focusing

Ioannis Valasakis wizofe

😬
Focusing
View GitHub Profile
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@aliva
aliva / move-cursor-linux.cpp
Created August 16, 2012 18:17
move mouse pointer to given position in linux
#include <X11/Xlib.h>
#include <iostream>
#include <unistd.h>
int main(void) {
Display* dpy = XOpenDisplay(0);
int scr = XDefaultScreen(dpy);
Window root_window = XRootWindow(dpy, scr);
int height = DisplayHeight(dpy, scr);
@todgru
todgru / gist:4128695
Last active April 12, 2019 00:45
Git Keeps asking for username password clone ssh git https
@raullenchai
raullenchai / compare_dir.py
Created November 28, 2012 20:46
Compare the lay out of dir1 and dir2, ignore the content of files
import os
def compare_dir_layout(dir1, dir2):
def _compare_dir_layout(dir1, dir2):
for (dirpath, dirnames, filenames) in os.walk(dir1):
for filename in filenames:
relative_path = dirpath.replace(dir1, "")
if os.path.exists( dir2 + relative_path + '\\' + filename) == False:
print relative_path, filename
return
@KartikTalwar
KartikTalwar / Documentation.md
Last active April 13, 2024 23:09
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
anonymous
anonymous / gist:5222225
Created March 22, 2013 15:35
##############################################################################################
##Running fsl from the command line
##some commands that I find useful
##
##############################################################################################
##############################################################################################
##############################################################################################
##Using the fslmaths and fslstats toolboxes
##############################################################################################
@smoitra87
smoitra87 / python2pdf.sh
Last active August 15, 2019 15:02
Convert python files to pdf and concatenate all pdfs. Requires pygmentize, pdflatex and pdftk
#!/bin/sh
allpdfs=""
for f in "$@" ; do
filename=$(basename "$f")
filename="${filename%.*}"
pygmentize -f tex -O linenos -O title=$( echo $filename | tr '_' '-').py -O full -O style=default -o /tmp/$filename.tex $f
pdflatex -jobname=$filename -output-directory=/tmp /tmp/$filename.tex
allpdfs="$allpdfs /tmp/$filename.pdf"
@mikecharles
mikecharles / activate.csh
Last active October 31, 2021 19:38
Activate and deactivate a conda environment in C Shell
#!/bin/csh
# Get the name of this script
if ( $?_ ) then
# With tcsh the name of the file being sourced is available in
# $_.
set script_name = `basename $_`
else
# Fall back to $0 which, sometimes, will be the name of the
@zachwill
zachwill / 538_colors.py
Created October 10, 2015 21:20
A simple FiveThirtyEight palette for Seaborn plots.
"""
A simple FiveThirtyEight palette for Seaborn plots.
"""
import seaborn as sns
import matplotlib.pyplot as plt
five_thirty_eight = [
"#30a2da",
"#fc4f30",
@hfreire
hfreire / qemu_osx_rpi_raspbian_jessie.sh
Last active March 24, 2024 14:35
How to emulate a Raspberry Pi (Raspbian Jessie) on Mac OSX (El Capitan)
# Install QEMU OSX port with ARM support
sudo port install qemu +target_arm
export QEMU=$(which qemu-system-arm)
# Dowload kernel and export location
curl -OL \
https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-4.1.7-jessie
export RPI_KERNEL=./kernel-qemu-4.1.7-jessie
# Download filesystem and export location