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
| mkfs.ext4 /dev/nbd1 | |
| mount /dev/nbd1 /mnt | |
| curl -sL https://github.com/alpinelinux/apk-tools/releases/download/v2.10.3/apk-tools-2.10.3-armhf-linux.tar.gz -o apk-tools.tar.gz | |
| tar xvzf apk-tools.tar.gz -C . | |
| ./apk --arch armhf -X http://dl-cdn.alpinelinux.org/alpine/v3.9/main/ -U --allow-untrusted --root /mnt --initdb add alpine-base curl | |
| cp /etc/resolv.conf /mnt/etc/resolv.conf | |
| mkdir -p /mnt/usr/local/sbin | |
| mkdir -p /mnt/usr/local/bin |
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
| #include <stdarg.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| __thread static char* __error = NULL; | |
| #define raize(fmt, ...) \ | |
| do { \ | |
| size_t errlen = snprintf(NULL, 0, (fmt), ##__VA_ARGS__); \ |
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
| { | |
| "workbench.colorTheme": "Mariana Nord", | |
| "C_Cpp.updateChannel": "Insiders", | |
| "files.exclude": { | |
| "**/.DS_Store": true, | |
| "**/.git": true, | |
| "**/.hg": true, | |
| "**/.svn": true, | |
| "**/*.o": true, | |
| "**/CVS": true, |
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
| # opening and closing windows and popovers | |
| defaults write -g NSAutomaticWindowAnimationsEnabled -bool false | |
| # smooth scrolling | |
| defaults write -g NSScrollAnimationEnabled -bool false | |
| # Fonts | |
| # TODO: set 1 for M1 | |
| defaults write -g AppleFontSmoothing -int 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
| role=$1 | |
| if ! [ $role ]; then | |
| echo "error: [sts] missing required argument ROLE" | |
| exit 1 | |
| fi | |
| account_id=$(aws sts get-caller-identity | jq .Account | sed s/\"//g) | |
| if ! [ $account_id ]; then | |
| echo "error: unable to get AWS account ID" | |
| exit 1 |
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
| kernel: | |
| image: linuxkit/kernel:5.4.39 | |
| cmdline: "console=ttyS0" | |
| init: | |
| - linuxkit/init:a68f9fa0c1d9dbfc9c23663749a0b7ac510cbe1c | |
| - linuxkit/runc:v0.8 | |
| - linuxkit/containerd:a4aa19c608556f7d786852557c36136255220c1f | |
| - linuxkit/ca-certificates:v0.8 | |
| onboot: | |
| - name: sysctl |
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
| redis-cli -p $1 -a $(grep -Po '(?<=^masterauth\s).*' ${2:-/etc/redis.conf} | sed 's/^\"//g' | sed 's/\"$//g') info | grep maxmemory_human |
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
| free -m | grep Mem | awk '{print $2}' |
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
| type GormTx struct { | |
| stack []*gorm.DB | |
| open int | |
| clos int | |
| } | |
| func NewTransaction(db *gorm.DB) *GormTx { | |
| return &GormTx{ | |
| stack: []*gorm.DB{db}, | |
| open: 0, |