Skip to content

Instantly share code, notes, and snippets.

View KernelPanicAUS's full-sized avatar
🎯
Focusing

Thomas Khalil KernelPanicAUS

🎯
Focusing
View GitHub Profile
@KernelPanicAUS
KernelPanicAUS / bulk-encode.sh
Created March 19, 2024 11:22
Bulk encode MKV files
#!/usr/bin/env bash
trap ctrl_c INT
function ctrl_c() {
echo "** Trapped Ctrl+C **"
exit 0 # Exit the script with exit code 0 (successful termination)
}
input_dir=$1
@KernelPanicAUS
KernelPanicAUS / main.tf
Last active July 31, 2020 13:40
Safer handling of resource multiplicity in Terraform
terraform {
required_version = ">= 0.12"
required_providers {
aws = "~> 2.0"
}
}
provider "aws" {
region = "eu-central-1"
@KernelPanicAUS
KernelPanicAUS / dl.py
Created June 16, 2020 11:11
springer-dl
from lxml import html
import requests
import os
root_url = "https://hnarayanan.github.io/springer-books/"
category = "Computer Science"
download_path = f"{os.getcwd()}/downloads/{category.lower().replace(' ', '_')}"
headers = {
"Host": "link.springer.com",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:77.0) Gecko/20100101 Firefox/77.0",
@KernelPanicAUS
KernelPanicAUS / README.md
Created March 4, 2020 13:51 — forked from mosquito/README.md
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service

[Unit]
Description=%i service with docker compose
Requires=docker.service
After=docker.service
@KernelPanicAUS
KernelPanicAUS / vpc.yaml
Created July 30, 2019 09:55 — forked from gmr/vpc.yaml
Demonstration CloudFormation YAML template for creating a VPC
AWSTemplateFormatVersion: '2010-09-09'
Description: VPC Network Stack
Metadata: {}
Mappings: {}
Conditions: {}
Outputs: {}
Parameters:
CidrBlock:
AllowedPattern: '((\d{1,3})\.){3}\d{1,3}/\d{1,2}'
Default: 10.0.0.0/16
@KernelPanicAUS
KernelPanicAUS / main.go
Created December 23, 2018 15:52
Merging JSON structures in go without explicit struct mappings
package main
import (
"encoding/json"
"fmt"
)
func main() {
inputJSON := `{"environment": "production", "runbook":"http://url","message":"there is a problem"}`
out := map[string]interface{}{}
@KernelPanicAUS
KernelPanicAUS / docker-bash-completion.md
Created November 29, 2018 07:35 — forked from rkuzsma/docker-bash-completion.md
How to configure Bash Completion on Mac for Docker and Docker-Compose

How to configure Bash Completion on Mac for Docker and Docker-Compose

Run:

brew install bash-completion

Add the following lines to your ~/.bash_profile:

 if [ -f $(brew --prefix)/etc/bash_completion ]; then

Keybase proof

I hereby claim:

  • I am kernelpanicaus on github.
  • I am bitshifta (https://keybase.io/bitshifta) on keybase.
  • I have a public key ASCawjzDh4ugbnLVdz4UIKvS8vyqs87Ra8gjLBc47KVRvwo

To claim this, I am signing this object:

@KernelPanicAUS
KernelPanicAUS / config.md
Created September 7, 2018 16:45 — forked from 0XDE57/config.md
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable.

I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@KernelPanicAUS
KernelPanicAUS / unmarshal.go
Created April 28, 2018 07:27
Unmarshal json into struct
package main
import (
"encoding/json"
"fmt"
"time"
)
type SnsMessage struct {
Type string `json:type`