select pg_terminate_backend(pid)
from pg_stat_activity
where datname = 'doomed_database'
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 --raw keys "$PATTERN" | xargs redis-cli del |
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
mysqldump --user=drupal --password=''--host='' --opt 'DB_NAME' > database.sql |
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
ifconfig | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" |
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
docker rm $(docker ps -a -q) | |
docker rmi $(docker images -q) | |
docker volume rm $(docker volume ls |awk '{print $2}') | |
rm -rf ~/Library/Containers/com.docker.docker/Data/* |
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
:%!python -m json.tool |
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
curl -s -w "%{time_total}\n" -o /dev/null http://www.google.com/ |
const datastore = require('@google-cloud/datastore')({
projectId: 'captureappprod',
keyFilename: '/path/to/key.json' // key optained from App engine / IAM admin / service accounts
});
function deviceCount(start, count=0) {
const batchSize = 300;
const query = datastore.createQuery('Device') // Device is the 'kind'
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
(New-Object System.DirectoryServices.DirectorySearcher("(&(objectCategory=User)(samAccountName=$($env:username)))")).FindOne().GetDirectoryEntry().memberOf |
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
# from linux guest OS | |
killall VBoxClient | |
VBoxClient-all |
NewerOlder