Skip to content

Instantly share code, notes, and snippets.

@karl-gustav
karl-gustav / smb.conf
Created November 26, 2017 13:14
my smb.conf file
#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
@karl-gustav
karl-gustav / fstab
Created November 26, 2017 13:13
permissive fstab (i.e. don't fail or wait for missing disks) /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=fe679315-e5fe-48bc-992a-cf9211b0ce73 / ext4 errors=remount-ro 0 1
@karl-gustav
karl-gustav / debounce.js
Created August 24, 2017 06:12
Standalone debounce function
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
Make sure that getty doesn't run (this might only matter for ttyAMA0)
trying latest version of https://github.com/riptideio/pymodbus (installing using python setyp.py install
@karl-gustav
karl-gustav / -etc-network-interfaces
Created June 20, 2017 20:44
How to setup static IP in raspberry pi
auto lo
iface lo inet loopback
#auto eth0
#iface eth0 inet dhcp
auto eth0
iface eth0 inet static
address 10.0.0.5
netmask 255.255.255.0
@karl-gustav
karl-gustav / .bash_aliases
Last active March 23, 2017 11:43
2017-03-23 Config files osX
# Git
alias hist='git hist'
alias st='git status'
alias gk='gitk &'
alias gka='gitk --all &'
alias arcdiff='arc diff'
alias arccreate="arc diff --create --reviewers '#ghostbusters'"
# Other
alias ll='ls -lh'
@karl-gustav
karl-gustav / fix.md
Last active November 28, 2016 11:31
How to edit the default sound files in OSX
  1. command + r
  2. terminal
  3. csrutil disable
  4. <make changes>
  5. csrutil enable
@karl-gustav
karl-gustav / My_languages.txt
Last active November 14, 2016 09:06
List of languages I know
Scale: 3 - fluent, 2 - proficient, 1 - novice, 0 - want to learn
JavaScript 1
Python 1
Java 1 (also I hate it)
Groovy 1
Bash 1
SQL 1 (longe time since i used it)
Go 3
Swift 2
@karl-gustav
karl-gustav / DYI.txt
Created November 1, 2016 07:45
DIY ideas
parametric speaker <-- directional speakers
@karl-gustav
karl-gustav / server.py
Created October 24, 2016 10:43
socket timeout
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
import BaseHTTPServer
import time
import socket
from SocketServer import ThreadingMixIn
import threading
socket.setdefaulttimeout(2)
class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):