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
git rebase --exec 'git commit --amend --no-edit -n -S' -i master |
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
#!/usr/bin/env bash | |
if [ -z "$1" ]; then | |
echo -e "Error:\n\tProvide IP as the first param" | |
echo -e "Usage:\n\t$0 <IP>" | |
exit 1 | |
fi | |
/etc/init.d/denyhosts stop | |
echo ' |
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
#!/usr/bin/env bash | |
script_runner=$(id -u -n) | |
file_owner=$(stat -c '%U' ./index.html) | |
[ $script_runner != $file_owner ] && { echo "please run script as $file_owner with 'sudo -u $file_owner $0'"; exit 1; } | |
echo "all good, do what you want $file_owner to do here" |
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
## arrow up | |
"\e[A":history-search-backward | |
## arrow down | |
"\e[B":history-search-forward |
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
#!/usr/bin/env bash -x | |
YYYYslashMM=$(date +%Y/%m) | |
cd ~/Downloads | |
mkdir -pv ./$YYYYslashMM | |
rm current | |
ln -s $YYYYslashMM/ current | |
mkdir -pv ./personal/$YYYYslashMM | |
cd ./$YYYYslashMM | |
rm personal | |
ln -s ../../personal/$YYYYslashMM/ personal |
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
[alias] | |
co = checkout | |
com = checkout master | |
fo = fetch origin | |
fom = fetch origin master | |
ci = commit | |
st = status | |
br = branch | |
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative |
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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
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
# Author: @yuan3y | |
# Date: 2017-09-29 | |
# Description: to make `jekyll serve` a system service and start on boot | |
# | |
# Usage: place this file at `/etc/systemd/system/jekyll.service` | |
# then run | |
# sudo systemctl start jekyll.service | |
# sudo systemctl enable jekyll.service | |
[Unit] |
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
/*jQuery way*/ | |
Array.from([["last_update",jQuery('.last_update').text().slice(25)]].append(jQuery('div.human').map((a,b)=>{return [[jQuery(b).children('.blank_humam').text(), jQuery(b).children('.fill_humam').prop('style').height]];}))).reduce((p,c,i)=>{p[c[0]]=c[1]; return p;},{}) | |
/*VanillaJS functional equivalence*/ | |
Array.from([["last_update",document.querySelector('.last_update').innerText.slice(25)]].append(Array.from(document.querySelectorAll('div.human')).map((b)=>{return [b.children[0].innerText, b.children[1].style.height];}))).reduce((p,c,i)=>{p[c[0]]=c[1]; return p;},{}) |
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 | |
# Copyright (c) 2017 @yuan3y | |
# Released under MIT License | |
# Tested on Ubuntu 16.04.2 LTS with default Unity interface | |
# | |
# USAGE: | |
# chmod +x install_prevent_lock_screen_dim.sh | |
# ./install_prevent_lock_screen_dim.sh | |
scriptFile=~/.prevent_lock_screen_dim.sh |
NewerOlder