Skip to content

Instantly share code, notes, and snippets.

View SalemHarrache's full-sized avatar
💭
😴

Salem Harrache SalemHarrache

💭
😴
View GitHub Profile
@davidfraser
davidfraser / Google Drive Sync Wine Scripting.md
Last active February 11, 2025 10:31
Google Drive Sync Wine Scripting

Google Drive Sync Wine Scripting

This is a set of scripts that help running Google Drive Backup and Sync under Wine, with multiple Google accounts.

Each account is given its own Wine prefix (a separate wine configuration).

To install, run install-gdrive-sync google_account

List the accounts set up in ~/.config/gdrive-accounts

@krisnod
krisnod / gist:56ff894f400cce7c742fb11fb2fde9cf
Last active April 6, 2022 18:46
RancherOS on Hetzner using software RAID (RAID 1)
Install:
----------
* Activate Hetzner Rescue System (Debian)
* Connect to Hetzner Rescue System using SSH and live boot RancherOS
(thanks goes to William Fleurant for showing how this can be done: https://github.com/wfleurant/boot-rancheros-hetzner/)
* apt-get update
* apt-get install kexec-tools aria2
@kyle-eshares
kyle-eshares / models.py
Created October 15, 2016 18:01
Strict ForeignKeys
from __future__ import unicode_literals
from django.db import models
from django.db.models.fields.related_descriptors import ForwardManyToOneDescriptor # noqa
class RelationNotLoaded(Exception):
pass
@timcharper
timcharper / README.md
Last active January 15, 2025 12:45
Macvlan using systemd

Before

yum install -y systemd-networkd
modprobe macvlan # make sure this returns no errors

Put config files in place

eth0.network and mac0.{netdev,network} go in /etc/systemd/network/

@vermotr
vermotr / upgrade.sh
Created April 28, 2016 11:24
Bash script to upgrade docker container after its image changed
#!/usr/bin/env bash
if [ $# -lt 1 ];then
echo Usage: `basename $0` image 1>&2
exit 1
fi
set -e
IMAGE=$1
CID=$(docker ps | grep $IMAGE | awk '{print $1}')
@oakfang
oakfang / js.py
Last active April 7, 2023 04:45
How to import js modules into python
import sys
import jiphy # pip install
from os import path
from types import ModuleType
class JsFinder(object):
def find_module(self, name, m_path):
name += '.js'
if m_path is not None:
@jcrist
jcrist / parametric_modules.py
Created August 30, 2015 20:47
Parametric Modules and functors in Python
from types import ModuleType
import sys
import inspect
from contextlib import contextmanager
class LocalImportFinder(object):
def find_module(self, fullname, path=None):
if path:
return None
@atomaths
atomaths / nginx.conf
Last active April 17, 2024 16:11
This is a FastCGI example server in Go.
## FastCGI
server {
location ~ /app.* {
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
}
}
## Reverse Proxy (이 방식으로 하면 http.ListenAndServe로 해야함)
server {