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
# Increase volume | |
amixer -q -D pulse sset Master 5%+ | |
# Decrease volume | |
amixer -q -D pulse sset Master 5%- | |
# Toggle mute | |
amixer -q -D pulse sset Master toggle |
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 | |
DIR_INI_TMP=$(mktemp -d) | |
find "${PHP_INI_DIR}"/conf.d/* | grep -v xdebug | xargs cp -t "${DIR_INI_TMP}" | |
PHP_INI_SCAN_DIR="${DIR_INI_TMP}" exec php "$@" |
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
# Find your VM name | |
VBoxManage list vms | |
VMNAME="YOUR_VM_NAME" | |
# Get VM disk path. | |
VMDISK1=$(VBoxManage showvminfo "${VMNAME}" --machinereadable | grep -E '^\"SATA' | head -n1 | cut -d'=' -f2 | sed -e 's/^"//' -e 's/"$//') | |
# Convert disk to VDI | |
if [ "${VMDISK##*.}" != "vdi" ]; then | |
VMDISK2="${VMDISK1%%.*}.$(cat /dev/urandom | env LC_CTYPE=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1).vdi" |
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
SELECT pg_terminate_backend(pg_stat_activity.pid) | |
FROM pg_stat_activity | |
WHERE pg_stat_activity.datname = 'TARGET_DB' | |
AND pid <> pg_backend_pid(); |
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
git log --follow -p -- FILE |
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 | |
parse_yml() { | |
[ -n "$2" ] && local prefix="$2" || { | |
local prefix=$(basename "$1"); prefix=${prefix%%.*} | |
} | |
local file="$1" | |
local s='[[:space:]]*' | |
local w='[a-zA-Z0-9_]*' | |
local fs="$(echo @|tr @ '\034')" |
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 | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
java -Dwebdriver.chrome.driver="${DIR}/drivers/chromedriver" -jar "${DIR}/selenium-server-standalone-3.4.0.jar" |
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
# Makes WIN key work as META to enable OS X keymap. | |
keymap.windows.as.meta=true |
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
app/console debug:container | tail -n +8 | head -n-5 | grep -v "alias for" | while read -r LINE; do CLASS=$(echo $LINE | awk '{print $2}'); SERVICE=$(echo $LINE | awk '{print $1}'); if [ -z $CLASS ]; then continue; fi; php -r "require_once 'app/autoload.php'; class_exists('$CLASS') || interface_exists('$CLASS') ?: print('Service $SERVICE ($CLASS) does not exist'.PHP_EOL);"; done |
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
# Put in the end of your ~/.profile or ~/.bashrc | |
PROMPT_COMMAND='printf %s "$PWD" > ~/.lastpwd' | |
[ -s ~/.lastpwd ] && cd "$(<~/.lastpwd)" |
NewerOlder