Emacs command summary, Thu Jul 25. link
Key| Key | Cmd |
|---|
| #!/usr/bin/env bash | |
| ## | |
| # Launch emacs from emacs.d folder you placed anywhere. | |
| # | |
| # @author gongqijian@gmail.com | |
| # @date 2016-07-21 | |
| # | |
| function usage { | |
| cat<<EOF |
| from MySQLdb import connect | |
| conn = connect(user="[USER]", passwd= "[PASSWORD]") | |
| cur = conn.cursor() | |
| cur.execute("show databases;") | |
| dbs_to_update = filter( | |
| lambda db: db not in ('information_schema', 'mysql', 'performance_schema'), | |
| [dbname[0] for dbname in cur.fetchall()]) |
| # https://www.digitalocean.com/community/questions/mysql-server-keeps-stopping-unexpectedly | |
| # http://pastie.org/8665237 | |
| # Generated by Percona Configuration Wizard (http://tools.percona.com/) version REL5-20120208 | |
| [mysql] | |
| # CLIENT # | |
| port = 3306 | |
| socket = /var/run/mysqld/mysqld.sock |
| #!/bin/bash | |
| set -Eeuo pipefail | |
| DOCKER_IMAGE="${DOCKER_IMAGE:-hello-world}" | |
| DOCKER_FLAGS="${DOCKER_FLAGS:-}" | |
| function __docker() { | |
| if command -v docker >/dev/null; then | |
| docker "$@" | |
| elif command -v podman >/dev/null; then | |
| podman "$@" |
| #!/usr/bin/env bash | |
| # USE WITH CAUTION | |
| # remove all exited containers | |
| docker rm $(docker ps -a -f status=exited -f status=created -q) | |
| # remove dangling volumes | |
| docker volume rm $(docker volume ls -f dangling=true -q) |
| #!/bin/bash | |
| set -eu | |
| SYSCTL_FILE=/etc/sysctl.d/90-tcp-bbr.conf | |
| # check root | |
| if [[ $EUID -ne 0 ]]; then | |
| echo "This script must be run as root" | |
| exit 1 | |
| fi |
| function addEvent(element, event, callback) { | |
| if (element.addEventListener) { | |
| element.addEventListener(event, callback, false) | |
| } else if (element.attachEvent) { | |
| element.attachEvent('on' + event, callback); | |
| } else { | |
| element['on' + event] = callback; | |
| } | |
| } |
Emacs command summary, Thu Jul 25. link
Key| Key | Cmd |
|---|
sudo pacman -S archlinux-keyringsource: https://www.ostechnix.com/fix-invalid-corrupted-package-pgp-signature-error-arch-linux/
| # conda-env-autodetect.plugin.zsh | |
| # Copy this file to ~/.oh-my-zsh/plugins/conda-env-autodetect/ | |
| # And make sure you have a .venv file with your env's name in your | |
| # preject's root folder. | |
| _conda_env_auto_activate() { | |
| if [ -f ".venv" ]; then | |
| # check conda is active |