Skip to content

Instantly share code, notes, and snippets.

View jacobsalmela's full-sized avatar
:octocat:
To all that makes us unique

Jacob Salmela jacobsalmela

:octocat:
To all that makes us unique
View GitHub Profile
@ekalinin
ekalinin / linux.sh
Created January 9, 2017 06:17 — forked from marcan/linux.sh
Linux kernel initialization, translated to bash
#!/boot/bzImage
# Linux kernel userspace initialization code, translated to bash
# (Minus floppy disk handling, because seriously, it's 2017.)
# Not 100% accurate, but gives you a good idea of how kernel init works
# GPLv2, Copyright 2017 Hector Martin <marcan@marcan.st>
# Based on Linux 4.10-rc2.
# Note: pretend chroot is a builtin and affects the current process
# Note: kernel actually uses major/minor device numbers instead of device name
@immae1
immae1 / .var.www.html.pihole.index.js
Last active February 12, 2021 16:55
This script is to add a random gif into the PIHOLE blockpage
// on page load, search for & display a random gif matching your search term using the Giphy API and add them to the pihole blockpage
// thanks to the nealrs (github)
// immae1 2017
var x = "Pi-hole: A black hole for Internet advertisements."
document.addEventListener('DOMContentLoaded', function () {
items = ["funny cats","dejay","nerd","beer"]; // tag array
var item = items[Math.floor(Math.random()*items.length)];
#!/usr/bin/env bash
# clock_skew.sh - Check remote hosts for clock skew (time drift), and
# output a warning or alert message based on defined thresholds.
#
# Instructions:
# Create a hosts.txt file that contains the list of hosts to be checked.
#
# hosts.txt should contain one host entry per line, and username and
# port fields are optional. Format:
#
@mholt
mholt / macapp.go
Last active June 17, 2024 10:48
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use:
@khang06
khang06 / 0-SD-GUIDE.md
Last active April 19, 2024 07:41
Switch SD Dumping 101

https://gbatemp.net/threads/nintendo-switch-sd-to-nsp-dumper.514816/ for a more automated and easier way to do this

This guide assumes you have previous experience with hactool and messing with your NAND. You aren't supposed to blindly copy commands in this, so read before pasting!

Also, the Python sections require Python 2.7 and pycrypto. Make sure your hactool is v1.2 or above.

Obtaining Your SD Seed

  1. Run https://cdn.discordapp.com/attachments/432400335235973120/478053328857726976/Compelled-Disclosure.nro (source at https://github.com/shadowninja108/Compelled-Disclosure, thx Shadów#6239)
@vertan
vertan / ssh_badge
Created July 10, 2018 15:21
Dynamic Badge depending on environment in iTerm/SSH
# Put this in ~/.ssh/config
Host *.production.host.net
LocalCommand echo -e "\033]50;SetProfile=Production\a"
Host *.staging.host.net
LocalCommand printf "\033]50;SetProfile=Staging\a\e[0;m"
Host *
PermitLocalCommand yes
# End ~/.ssh/config
package main
import (
"context"
"fmt"
"net"
"os/exec"
"strconv"
"strings"
"sync"
@makew0rld
makew0rld / go-build-all.sh
Last active April 26, 2024 09:51
Cross compile for all possible Golang targets. This script will always be updated, because it uses the `go` command to see what can be built.
#!/usr/bin/env bash
# Based on https://gist.github.com/eduncan911/68775dba9d3c028181e4
# but improved to use the `go` command so it never goes out of date.
type setopt >/dev/null 2>&1
contains() {
# Source: https://stackoverflow.com/a/8063398/7361270
[[ $1 =~ (^|[[:space:]])$2($|[[:space:]]) ]]
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
name: startup
name: startup
namespace: default
spec:
selector:
matchLabels:
@protosam
protosam / Dockerfile
Last active January 4, 2024 19:59
Nvidia Jetson sdkmanager in Docker Notes
FROM ubuntu:18.04
# Install SDK deps
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
libgconf-2-4 \
libcanberra-gtk-module \
locales \