Skip to content

Instantly share code, notes, and snippets.

View yangm97's full-sized avatar
🏠
Working from home

Yan Minari yangm97

🏠
Working from home
View GitHub Profile
@KartikTalwar
KartikTalwar / Documentation.md
Last active April 13, 2024 23:09
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@hoelzro
hoelzro / multi.lua
Last active November 30, 2022 02:55
Multiple inheritance in Lua
local Mom = {}
local Dad = {}
local Child = {}
function Mom:work()
print "I'm a particle physicist!"
end
function Dad:work()
print "I'm a computer guy!"
@xaviervia
xaviervia / nginx-environment.md
Last active July 1, 2019 12:45
Nginx and Docker links with environment variables, a love story

How to add environment variables to nginx.conf

This is the hack approach to adding environment variables to the nginx configuration files. As with most Google results for this search, the reason is Docker.

The setup

I intended to deploy two Docker containers.

@andreagrandi
andreagrandi / parse_json_post.go
Created August 19, 2014 13:28
Parse a JSON http POST in GoLang
package main
import (
"encoding/json"
"fmt"
"net/http"
)
type test_struct struct {
Test string
@beardicus
beardicus / edgerouter-qos
Last active September 29, 2023 16:41
EdgeRouter Lite QOS Settings
#
# fair-queue based settings for EdgeRouter Lite traffic shaping
#
# download is typically 30 and change. everything can burst to 100%
# of bandwidth, priority rules keep the garbage in check
set traffic-policy shaper download
set traffic-policy shaper download bandwidth 30Mbit
@pantelis
pantelis / coreos-windows-share.sh
Last active November 17, 2019 02:43
Mount Windows share drives on CoreOS
# WARNING - THIS IN NOT a SHELL SCRIPT - JUST a LIST of COMMANDS
# based on https://github.com/coreos/coreos-overlay/issues/595 with links updated
# Build cifs-utils in a container and copy it into /tmp on the host.
$docker run -t -i -v /tmp:/host_tmp fedora /bin/bash
# On the container bash prompt
yum groupinstall -y "Development Tools" "Development Libraries"
yum install -y tar
yum install -y bzip2
curl http://ftp.samba.org/pub/linux-cifs/cifs-utils/cifs-utils-6.3.tar.bz2 | bunzip2 -c - | tar -xvf -
@datakurre
datakurre / configuration.nix
Last active March 1, 2021 15:19
Bootable NixOS USB stick for kiosk or demo usage
{ config, lib, pkgs, ... }:
with lib;
{
imports = [
# ISO image
<nixpkgs/nixos/modules/installer/cd-dvd/iso-image.nix>
# Hardware support similar to installer Live CD
<nixpkgs/nixos/modules/profiles/all-hardware.nix>
@diffficult
diffficult / edgerouter-qos
Last active July 9, 2023 16:32 — forked from beardicus/edgerouter-qos
EdgeRouter Lite QOS Settings
#
# fair-queue based settings for EdgeRouter Lite traffic shaping
#
# download is typically 6 and change. everything can burst to 100%
# of bandwidth, priority rules keep the garbage in check
set traffic-policy shaper download
set traffic-policy shaper download bandwidth 30Mbit
@Gwerlas
Gwerlas / jira2gitlab.py
Last active November 22, 2023 12:51
Migrate Jira issues to Gitlab
import requests
from requests.auth import HTTPBasicAuth
import re
from StringIO import StringIO
import uuid
# Inspired from https://gist.github.com/toudi/67d775066334dc024c24
# Tested on Jira 7.4 and Gitlab 2.2 with Python 2.7
JIRA_URL = 'https://your-jira-url.tld/'
JIRA_ACCOUNT = ('jira-username', 'jira-password')
@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active April 27, 2024 18:51
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com