Skip to content

Instantly share code, notes, and snippets.

View Zenithar's full-sized avatar

Thibault NORMAND Zenithar

View GitHub Profile
@kemadz
kemadz / vbox_arch.sh
Last active November 21, 2015 17:34
LiveISO Part of ArchLinux Virtualbox Guest Install Script
#!/bin/sh
# LiveISO Part of ArchLinux Virtualbox Guest Install Script
# system clock
# date `date +%m%d%H%M%Y.%S --date='-8 hour'`
ntpdate time.asia.apple.com
# partitions
sgdisk --zap-all /dev/sda
sgdisk \
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 22, 2024 05:53
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@pascalpoitras
pascalpoitras / config.md
Last active May 11, 2024 04:13
My WeeChat configuration

WeeChat Screenshot

Mouse


enable


@rgarcia
rgarcia / basic.go
Created June 11, 2014 17:27
golang basic auth transport
import (
"encoding/base64"
"fmt"
"net/http"
)
type BasicAuthTransport struct {
Username string
Password string
}
@kwilczynski
kwilczynski / disable-ipv6.sh
Last active April 11, 2024 11:09
Amazon Linux OS tweaks
#!/bin/bash
set -u
set -e
set -o pipefail
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
cat <<'EOF' > /etc/modprobe.d/blacklist-ipv6.conf
@ikwattro
ikwattro / statement.json
Created March 8, 2016 19:51
unwind batching
{
"statements": [
{
"statement": "UNWIND {nodes} as x MERGE (o:Object {um: x.umid}) SET o.value = x.value, o.updated = timestamp()",
"parameters": {
"nodes": [
{
"umid": 1,
"value": "bla bla"
},
@mak
mak / get_locky.py
Created June 22, 2016 22:16
locky sample downloader
import sys
import hashlib
import struct
import requests
def decode(data,seed,step):
r = []
k = seed
for c in map(ord,data):
r.append(chr(c ^ k))
@augbog
augbog / Free O'Reilly Books.md
Last active May 14, 2024 10:27
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@ageis
ageis / systemd_service_hardening.md
Last active May 23, 2024 08:01
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@paragonie-scott
paragonie-scott / jose-security.md
Last active June 12, 2020 11:32
Suggestions for a Secure JOSE Alternative (or Protocol Upgrade)

Changes to JOSE that will prevent insecurity

Deletions

JWS and JWE

Drop the alg header

Neither JOSE users nor JOSE library designers should be required to understand cryptography primitives. At a lower level, this can lead to badly implemented primitives. On a higher level, this can lead to reasoning by lego.