Skip to content

Instantly share code, notes, and snippets.

@LiquidityC
LiquidityC / Makefile
Last active December 1, 2023 03:24
Generic drop in Makefile
VERSION = \"1.0.0\"
PREFIX ?= out
INCDIR = inc
SRCDIR = src
LANG = c
OBJDIR = .obj
MODULE = binary_name
CC = gcc
@X3MBoy
X3MBoy / nano-shorts.md
Created April 28, 2017 20:27 — forked from franz-josef-kaiser/nano-shorts.md
nano keyboard shortcuts

^ = Ctrl key M = Alt key

^G      (F1)            Display this help text
^X      (F2)            Close the current file buffer / Exit from nano
^O      (F3)            Write the current file to disk
^J      (F4)            Justify the current paragraph

^R      (F5)            Insert another file into the current one
@TomWhitwell
TomWhitwell / compose.py
Created November 20, 2016 17:51
Python script to generate random scores for modular synth
import random
import string
# -*- coding: utf-8 -*-
def randomname(length = 6):
vowels = ['a','e','i','o','u','']
consonants = ['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z']
a = random.sample(consonants,length/2)
x = 1
@wpg4665
wpg4665 / reclaimWindows10.ps1
Last active November 11, 2018 02:26 — forked from alirobe/reclaimWindows10.ps1
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Forked from http://pastebin.com/gQxCUkLP
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Original Version: 1.4, 2016-01-16
# Tweaked based on personal preferences for @alirobe 2016-03-23 - v1.4.1
# NOTE: MAKE SURE YOU READ THIS SCRIPT CAREFULLY BEFORE RUNNING IT + ADJUST COMMENTING AS APPROPRIATE
##########
# Ask for elevated permissions if required
If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) {
@criccomini
criccomini / airflow.cfg
Created June 22, 2016 15:09
airflow.cfg
# A redacted version of airflow.cfg
[core]
airflow_home = /etc/airflow
dags_folder = /etc/airflow/dags
base_log_folder = /var/log/airflow
s3_log_folder = None
remote_base_log_folder = gs://some-bucket
remote_log_conn_id = gcp_di
executor = LocalExecutor
@criccomini
criccomini / airflow-supervisord.conf
Created June 22, 2016 14:54
airflow-supervisord.conf
; Configuration for Airflow webserver and scheduler in Supervisor
[program:airflow]
command=/bin/airflow webserver
stopsignal=QUIT
stopasgroup=true
user=airflow
stdout_logfile=/var/log/airflow/airflow-stdout.log
stderr_logfile=/var/log/airflow/airflow-stderr.log
environment=HOME="/home/airflow",AIRFLOW_HOME="/etc/airflow",TMPDIR="/storage/airflow_tmp"
@dseg
dseg / nftables.conf
Created April 22, 2016 07:45
A basic nftables config. Only accept ssh, http and https.
#!/usr/bin/nft -f
# ipv4/ipv6 Simple & Safe Firewall
# you can find examples in /usr/share/nftables/
table inet filter {
chain input {
type filter hook input priority 0;
# allow established/related connections
ct state {established, related} accept
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 23, 2024 06:15
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@oleksii-zavrazhnyi
oleksii-zavrazhnyi / gist:968e5ea87e99d9c41782
Created November 28, 2014 17:32
BASH Absolute path of current script
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

Is a useful one-liner which will give you the full directory name of the script no matter where it is being called from

These will work as long as the last component of the path used to find the script is not a symlink (directory links are OK). If you want to also resolve any links to the script itself, you need a multi-line solution:

SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink