Skip to content

Instantly share code, notes, and snippets.

View jimmiehansson's full-sized avatar
🇸🇪
Breaking things to improve them

Jimmie Hansson jimmiehansson

🇸🇪
Breaking things to improve them
View GitHub Profile

Add to your contaier config /etc/pve/lxc/XXX.conf:

lxc.apparmor.profile: unconfined
lxc.cgroup.devices.allow: a
lxc.cap.drop: 
lxc.mount.auto: proc:rw sys:rw

@jimmiehansson
jimmiehansson / openvpn-debian-nordvpn.md
Created July 30, 2018 16:06
Setting OpenVPN on Debian (NordVPN as provider)

Setting OpenVPN on Debian (NordVPN as provider)

Tested on Debian 9.

First, edit /etc/default/openvpn and uncomment the following setting to prevent any VPN from being launched automatically:

AUTOSTART="none"
@jimmiehansson
jimmiehansson / sync_gdrive.py
Created March 19, 2018 09:36 — forked from markuscraig/sync_gdrive.py
Rclone + Google Drive sync script
#!/usr/bin/env python
import os
import shutil
import subprocess
# global variables
SYNC_DIRS = [
{
'src': "/Volumes/PhotoArchive/Lightroom",
@jimmiehansson
jimmiehansson / vzdump-hook-script.pl
Created March 18, 2018 20:44
Perl script that uploads backup files to cloud storage using rclone, removes backups older then 1 week.
#!/usr/bin/perl -w
# example hook script for vzdump (--script option)
use strict;
print "HOOK: " . join (' ', @ARGV) . "\n";
my $phase = shift;
@jimmiehansson
jimmiehansson / ultimate-ut-cheat-sheet.md
Created September 14, 2017 13:15 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@jimmiehansson
jimmiehansson / Install_tmux
Created August 31, 2017 07:53 — forked from simme/Install_tmux
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@jimmiehansson
jimmiehansson / jira-behing-nginx-ssl
Created July 6, 2017 17:01 — forked from jtbonhomme/jira-behing-nginx-ssl
Atlassian JIRA behind nginx + SSL
# force HTTP to HTTPS - /etc/nginx/conf.d/nonssl.conf
server {
listen 80;
server_name jira.example.com;
access_log off;
return 301 https://$server_name$request_uri;
}
# /etc/nginx/conf.d/jira.conf
server {
@jimmiehansson
jimmiehansson / sysctl.conf
Created June 27, 2017 16:38 — forked from kfox/sysctl.conf
Linux kernel tuning settings for large number of concurrent clients
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
@jimmiehansson
jimmiehansson / install-comodo-ssl-cert-for-nginx.rst
Created June 22, 2017 21:32 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@jimmiehansson
jimmiehansson / 0_reuse_code.js
Created May 20, 2014 04:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console