This file contains 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 -e | |
# These need to be set. | |
#export EC2_HOME="/path/to/ec2-api-tools" | |
#export AWS_ACCESS_KEY='XXXXXXXXXXXXXXXXXXXX' | |
#export AWS_SECRET_KEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' | |
#export PATH="$PATH:${EC2_HOME}/bin" | |
ami_id='ami-123abc12' | |
availability_zone='eu-west-1a' | |
keypair="johndoe@example.com" |
This file contains 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 | |
# Inspired by https://blog.nimamoh.net/yubi-key-gpg-wsl2/ | |
# Guide: | |
# Install GPG on windows & Unix | |
# Add "enable-putty-support" to gpg-agent.conf | |
# Download wsl-ssh-pageant and npiperelay and place the executables in "C:\Users\[USER]\AppData\Roaming\" under wsl-ssh-pageant & npiperelay | |
# https://github.com/benpye/wsl-ssh-pageant/releases/tag/20190513.14 | |
# https://github.com/NZSmartie/npiperelay/releases/tag/v0.1 | |
# Adjust relay() below if you alter those paths |
This file contains 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 -ex | |
# Paste this into ssh | |
# curl -sL https://gist.github.com/andsens/2913223/raw/bootstrap_homeshick.sh | tar -xzO | /bin/bash -ex | |
# When forking, you can get the URL from the raw (<>) button. | |
### Set some command variables depending on whether we are root or not ### | |
# This assumes you use a debian derivate, replace with yum, pacman etc. | |
aptget='sudo apt-get' | |
chsh='sudo chsh' |
This file contains 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 | |
## backup each mysql db into a different file, rather than one big file | |
## as with --all-databases. This will make restores easier. | |
## To backup a single database simply add the db name as a parameter (or multiple dbs) | |
## Putting the script in /var/backups/mysql seems sensible... on a debian machine that is | |
## Create the user and directories | |
# mkdir -p /var/backups/mysql/databases | |
# useradd --home-dir /var/backups/mysql --gid backup --no-create-home mysql-backup | |
## Remember to make the script executable, and unreadable by others |
This file contains 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 | |
# wait for backgrounded jobs and propagate $?>0. | |
local pid | |
while read -r pid; do wait "$pid"; done < <(jobs -p) | |
# wait for backgrounded jobs, propagate $?>0, and exit early on failure. | |
while (($(jobs -p | wc -l) > 0)); do | |
if wait -n; then | |
: |
This file contains 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
[log] | |
date = relative | |
[format] | |
pretty = shortlog | |
[pretty] | |
shortlog = format:%C(auto,yellow)%h%C(auto,magenta)% G? %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(7,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D |
This file contains 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 | |
# https://askubuntu.com/questions/1168123/how-do-i-get-my-bluetooth-device-working/1192200#1192200 | |
set -e | |
SCRIPTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | |
main() { | |
local kernver | |
kernver=$(uname -r) | |
sudo apt update |
This file contains 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 | |
### BEGIN INIT INFO | |
# Provides: generic-prog | |
# Required-Start: $local_fs $remote_fs $network | |
# Required-Stop: $local_fs $remote_fs $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Generic Program | |
# Description: Generic Program is a generic program to do generic things with | |
### END INIT INFO |
This file contains 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
import { ComponentPaginationQuery } from "./artifacts/ComponentPaginationQuery.graphql"; | |
import { Component_items$key } from "./artifacts/Component_items.graphql"; | |
export function Component(props: { itemsFragment: Component_items$key }) { | |
const { | |
data: { items }, | |
} = usePaginationFragment<ComponentPaginationQuery, Component_items$key>( | |
graphql` | |
fragment Component_items on Viewer | |
@argumentDefinitions( |
NewerOlder