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 | |
| cat <<EOF > /etc/cni/net.d/100-crio-flannel.conf | |
| { | |
| "cniVersion": "0.3.0", | |
| "name": "mynet", | |
| "type": "flannel" | |
| } | |
| EOF | |
| cat <<EOF > /etc/cni/net.d/200-loopback.conf |
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
| my-df() { | |
| df -h | | |
| awk '$NF != "/" && NR > 1 {print $NF}' | | |
| xargs -I{} echo --exclude {} | | |
| sudo xargs du / -h \ | |
| --exclude /sys \ | |
| --exclude /proc | | |
| tee du.out | | |
| sort -h | | |
| less |
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 | |
| # Not actually executable, but a reminder for myself | |
| # see https://lunaticgeek.com/whatsapp-stickers/ | |
| # see https://gist.github.com/patrickhammond/4ddbe49a67e5eb1b9c03#gistcomment-2903816 | |
| TMP="$(mktemp -d)" | |
| wget https://dl.stickershop.line.naver.jp/products/0/0/1/3962468/iphone/[email protected] --no-check-certificate | |
| # unzip, folder is stickers@2x | |
| cd 'stickers@2x' |
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
| Host */* | |
| ProxyCommand ssh %r@$(dirname %h) -W $(basename %h):%p | |
| Host *_* | |
| ProxyCommand ssh %r@$(cut -f1 -d_ <<< '%h') -W $(: '%h'; echo "${_##*_}"):%p | |
| # SSH over Session Manager | |
| Host aws-ssm-* | |
| ProxyCommand sh -c "aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'" |
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 | |
| declare SALT # One time pad | |
| if [ "${1+x}" = x ]; then | |
| SALT="$1" | |
| else | |
| # 64byte = 512bit | |
| SALT="$(head -c64 /dev/random)" | |
| fi |
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 sh | |
| osascript -e " | |
| on GetCurrentApp() | |
| tell application \"System Events\" | |
| set _app to item 1 of (every process whose frontmost is true) | |
| return name of _app | |
| end tell | |
| end GetCurrentApp | |
| set _app to GetCurrentApp() | |
| tell application _app |
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
| /** | |
| * Definition for singly-linked list. | |
| * public class ListNode { | |
| * int val; | |
| * ListNode next; | |
| * ListNode(int x) { val = x; } | |
| * } | |
| */ | |
| class Solution { | |
| public ListNode addTwoNumbers(ListNode l1, ListNode l2) { |
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
| public class LongestPalindrome { | |
| public String longestPalindrome(String s) { | |
| if(s.length() <= 1) return s; | |
| int top = s.length() - 1; | |
| char[] input = s.toCharArray(); | |
| String palindrome = String.valueOf(s.charAt(0)); | |
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
| /Applications/kitty.app/Contents/MacOS/kitty --title nvim --override maxos_quit_when_last_window_closed=yes --instance-group=nvim /bin/zsh -i -c 'exec nvim' |
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
| http { | |
| server { | |
| listen *:80; | |
| location / { | |
| proxy_pass http://localhost:8080/; | |
| } | |
| } | |
| } |