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
#!/bin/bash | |
# This script checks if the 'main' branch exists in the current Git repository. | |
# If 'main' exists, it checks out the 'main' branch. | |
# If 'main' does not exist, it checks out the 'master' branch. | |
# Check if the 'main' branch exists | |
# git rev-parse --verify <branch_name> returns 0 if the branch exists, non-zero otherwise. | |
if git rev-parse --verify main >/dev/null 2>&1; then | |
echo "Branch 'main' exists. Checking out 'main'..." |
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
youtube-dl -i --extract-audio --audio-format mp3 |
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
fallocate -l 4G /swapfile | |
chmod 600 /swapfile | |
mkswap /swapfile | |
swapon /swapfile | |
swapon -s |
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
# Press F5 on command line to drop cache | |
# Tested on Ubuntu 16 | |
is_sudoed=false | |
eval "f5() {zle push-line;LBUFFER+='fkey_f5';zle accept-line}" | |
zle -N f5 | |
bindkey '^[[15~' f5 | |
function fkey_f5 { | |
if [ "$is_sudoed" = 'true' ]; then | |
sync | sudo tee /proc/sys/vm/drop_caches | |
else |
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
// auto fill captcha | |
// open http://www.seoreviewtools.com/bulk-seomoz-authority-checker/ | |
// open console | |
// paste this code | |
var questionText = $('.captcha').text() | |
var questionNumber = questionText.substring(0, questionText.indexOf('=')); | |
questionNumber = questionNumber.substring(8) | |
var answer = eval(questionNumber) | |
$('#captcha').val(answer) |