Make sure you have installed the following commands:
- swaymsg
- jq
- slurp
- awk
#!/usr/bin/env sh | |
sudo update-alternatives --install \ | |
/usr/bin/llvm-config llvm-config /usr/bin/llvm-config-3.4 200 \ | |
--slave /usr/bin/llvm-ar llvm-ar /usr/bin/llvm-ar-3.4 \ | |
--slave /usr/bin/llvm-as llvm-as /usr/bin/llvm-as-3.4 \ | |
--slave /usr/bin/llvm-bcanalyzer llvm-bcanalyzer /usr/bin/llvm-bcanalyzer-3.4 \ | |
--slave /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-3.4 \ | |
--slave /usr/bin/llvm-diff llvm-diff /usr/bin/llvm-diff-3.4 \ | |
--slave /usr/bin/llvm-dis llvm-dis /usr/bin/llvm-dis-3.4 \ |
This is a sample script for uploading files to Google Drive using Javascript. The files are uploaded by Drive API v3. gapi.client.drive.files.create()
can create an empty file on Google Drive. But it cannot directly upload files including contents. I think that this might not be able to upload files and metadata with the multipart/related, although this might be resolved by the future update. So now, as one of workarounds, I use using XMLHttpRequest.
In this sample script, a text file including contents is created under a folder.
#!/bin/env bash | |
sudo snap remove firefox | |
sudo add-apt-repository ppa:mozillateam/ppa | |
echo ' | |
Package: * | |
Pin: release o=LP-PPA-mozillateam | |
Pin-Priority: 1001 | |
' | sudo tee /etc/apt/preferences.d/mozilla-firefox |
" from https://github.com/aduros/dotfiles/blob/eab476fc62e74e46cb41bb5c094cede7a28a014f/home/.config/nvim/options.vim#L27 | |
autocmd BufNewFile,BufRead *.hx set filetype=haxe | |
autocmd BufNewFile,BufRead *.jsfl set filetype=javascript | |
autocmd BufNewFile,BufRead ~/.config/dunst/dunstrc set filetype=dosini | |
autocmd BufNewFile,BufRead ~/.config/polybar/config set filetype=dosini | |
autocmd BufNewFile,BufRead ~/.config/tridactyl/tridactylrc set filetype=vim | |
autocmd BufNewFile,BufRead ~/.config/zathura/zathurarc set filetype=config | |
autocmd BufNewFile,BufRead ~/.lesskey set filetype=config |
# Install ARCH Linux with encrypted file-system and UEFI | |
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description. | |
# Download the archiso image from https://www.archlinux.org/ | |
# Copy to a usb-drive | |
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux | |
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration. | |
# This assumes a wifi only system... |
#!/bin/bash | |
# from https://gist.github.com/kovetskiy/a4bb510595b3a6b17bfd1bd9ac8bb4a5#gistcomment-3367404 | |
set -o pipefail | |
Help=$(cat <<-"HELP" | |
my-script — does one thing well | |
Usage: |
For excessively paranoid client authentication.
Original: https://gist.github.com/mtigas/952344
openssl x509 -in server.crt -out server.der -outform DER
openssl x509 -in server.der -inform DER -out server.pem -outform PEM
1. Dump the data only sql to file | |
$ pg_dump --data-only --inserts YOUR_DB_NAME > dump.sql | |
2. scp to local | |
3. Remove the SET statements at the top | |
such as: | |
SET statement_timeout = 0; | |
SET client_encoding = 'SQL_ASCII'; | |
4. Remove the setval sequence queries |
#!/usr/bin/env bash | |
set -ex | |
trap 'handleError' ERR | |
handleError() { | |
echo "" | |
echo "If you encountered an error, please consider fixing" | |
echo "the script for your environment and creating a pull" |