add.(b, w, l) {w}
Op 1 :Dn/An/(An)/Im/ea
Op 2 :Dn/(An)/An/ea
Adds the value of the first operand to second operand. If the second
operand is an address register, the ADDA instruction is used instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Script to rotate wireguard tunnels. Basically just calls wg-quick | |
| # Works best if you have many tunnel configuration files in /usr/local/etc/wireguard | |
| # (or whereever wg puts them on your system). | |
| # | |
| # Works in cron: | |
| # */15 * * * * /usr/local/scripts/tunnel.sh >/dev/null 2>&1 | |
| # | |
| # Note: ``>/dev/null 2>&1`` is recommended to avoid spamming logs/root mail |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| The where() function returns the output: | |
| ~/tmp/where ❯ go run main.go | |
| main.a in "/Users/[redacted]/tmp/where/main.go" returns from line 19 | |
| Maybe useful for debugging some large function when you don't have the patience for it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| for file in $(find . -name "*.go" -type f); do | |
| line=$(golint -set_exit_status ${file} 2>&1 | grep underscore | grep -Eo "[a-zA-Z_]+ should be.*" ) | uniq | |
| old=$(echo $line | cut -d " " -f 1) | |
| new=$(echo $line | cut -d " " -f 4) | |
| echo "$old -> $new" | |
| sed -e "s/${old}/${new}/g" $file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package flatten | |
| // FlattenArray flattens the array input, and places inputues into the array output | |
| // When a nested array is encountered, FlattenArray will recurse into itself | |
| // | |
| // In the case that an element in input is not either int or []int, FlattenArray returns nil | |
| func FlattenArray(input []interface{}) []int { | |
| var output []int | |
| for _, val := range input { | |
| switch i := val.(type) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .text | |
| .global _start | |
| _start: | |
| // Load registers with values | |
| ldr r1, =message // Load message into r1 | |
| bl strlen // Call strlen | |
| mov r7, #4 // Syscall write | |
| mov r4, #10 // Loop counter | |
| loop: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -e | |
| function yesno() { | |
| read -p "$1 Continue? (y/n): " | |
| case $(echo -e "$REPLY" | tr '[A-Z]' '[a-z]') in | |
| y|yes) echo "yes" ;; | |
| *) echo "no" ;; | |
| esac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #Ruthlessly slaughters a process by process name | |
| function slaughter(){ | |
| kill -9 $(pgrep $1) | |
| } |
I hereby claim:
- I am tywkeene on github.
- I am tywkeene (https://keybase.io/tywkeene) on keybase.
- I have a public key whose fingerprint is F665 D69D 51BD D628 0C87 145C 9B59 7B45 757B 8D52
To claim this, I am signing this object:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "bufio" | |
| "crypto/sha512" | |
| "encoding/hex" | |
| "encoding/json" | |
| "fmt" | |
| "io/ioutil" | |
| "os" |
NewerOlder