Skip to content

Instantly share code, notes, and snippets.

View chaicko's full-sized avatar

Alejandro Schwoykoski chaicko

View GitHub Profile
@chaicko
chaicko / .gitattributes
Created February 8, 2018 01:58 — forked from bsmith89/.gitattributes
Example files for http://blog.byronjsmith.com/makefile-shortcuts.html, a default makefile for computational research projects
*.ipynb filter=dropoutput_jupyter
*.[tc]sv diff=daff-csv
*.[tc]sv merge=daff-csv
@chaicko
chaicko / boxstarter.ps1
Last active November 26, 2017 14:51 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@chaicko
chaicko / recipes.sh
Created November 6, 2017 23:49
Bash recipes
#!/bin/bash
# Rename a bunch of files by removing the last 2 characters of the filename (not the extension)
for f in *.*; do fname=${f%.*}; extension=${f##*.}; mv $f ${fname%??}.${extension}; done
# How? use bash substituions http://www.tldp.org/LDP/abs/html/parameter-substitution.html
@chaicko
chaicko / gist:3ba9296ab41cb245ed0861965272daec
Created October 19, 2017 23:09 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@chaicko
chaicko / Makefile
Created March 28, 2017 05:41 — forked from 17twenty/Makefile
Simple Misc Driver Example
# Simple Makefile to build a simple misc driver
# Nick Glynn <Nick.Glynn@feabhas.com>
#
obj-m += misc_example.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
CC := $(CROSS_COMPILE)gcc
@chaicko
chaicko / shell-cmds.md
Last active February 22, 2017 00:09
Useful shell commands to do specific tasks

Mounting a remote Filesystem locally

Sometimes you need to mount a remote file system locally in order to share files, do some work or deploy a program remotelly. There are several protocols to do this like NFS, Samba, SSHFS and others. Here are some recipes.

Using SSHFS

Provided you have a user and password (or ssh keys loaded in the remote host) and an ssh server is running on the remote host, you can mount the remote filesystem through an SSH connection.

First, install sshd:

#!/bin/bash
[ -d /usr/share/fonts/opentype ] || sudo mkdir /usr/share/fonts/opentype
sudo git clone --depth 1 --branch release https://github.com/adobe-fonts/source-code-pro.git /usr/share/fonts/opentype/scp
sudo fc-cache -f -v
@chaicko
chaicko / zsh.md
Created October 3, 2016 18:09 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu
#! /usr/bin/awk -f
# A script to extract the actual suppression info from the output of (for example) valgrind --leak-check=full --show-reachable=yes --error-limit=no --gen-suppressions=all ./minimal
# The desired bits are between ^{ and ^} (including the braces themselves).
# The combined output should either be appended to /usr/lib/valgrind/default.supp, or placed in a .supp of its own
# If the latter, either tell valgrind about it each time with --suppressions=<filename>, or add that line to ~/.valgrindrc
# NB This script uses the |& operator, which I believe is gawk-specific. In case of failure, check that you're using gawk rather than some other awk
# The script looks for suppressions. When it finds one it stores it temporarily in an array,
# and also feeds it line by line to the external app 'md5sum' which generates a unique checksum for it.
@chaicko
chaicko / disallow-new.js
Created April 15, 2016 14:59 — forked from mattdesl/disallow-new.js
avoiding new in classes
// Allows:
// funkyParser()
module.exports = function createFunkyParser(opt) {
return new FunkyParser(opt)
}
function FunkyParser(opt) {
// make params optional
opt = opt || {}