Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View chaicko's full-sized avatar

Alejandro Schwoykoski chaicko

View GitHub Profile
"""
HexByteConversion
Convert a byte string to it's hex representation for output or visa versa.
ByteToHex converts byte string "\xFF\xFE\x00\x01" to the string "FF FE 00 01"
HexToByte converts string "FF FE 00 01" to the byte string "\xFF\xFE\x00\x01"
"""
#-------------------------------------------------------------------------------
@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 / gist:9f6cad3dc87827efe0eb
Created August 9, 2014 23:21
Notes on installing Ubuntu 14.04.1 on machine based on Asrock H97M-ITX/ac motherboard
There is an issue with kernel included in Ubuntu 14.04.1 x64 (3.13...) and the driver for the Wifi card of the motherboard (RTL8821ae).
Custom install CD won't boot with a kernel panic if the wifi module is enabled. So to fix this you'll need to update the kernel. Proceed as follows:
1) disable wifi module in the BIOS setup
2) Install Ubuntu as usual
3) Once installed, download and install the script located in https://github.com/GM-Script-Writer-62850/Ubuntu-Mainline-Kernel-Updater. Follow the instructions there
4) Run "KernelUpdateChecker -no-rc -r utopic" (it will say a new kernel is available, mine was 3.169
5) Run /tmp/kernel-update
6) Just in case, don't delete old kernel when prompted!
7) Reboot, enter BIOS and enable wifi module
@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