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/sh | |
if [ -z "$1" ] | |
then | |
echo "Input ssh creditals" | |
exit; | |
fi | |
#check key exists | |
if [ ! -f ~/.ssh/id_rsa ]; then |
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
window.genPk = function (argument) { | |
if (typeof argument == 'undefined'){ | |
argument = {}; | |
} | |
if (typeof argument.date == 'undefined'){ | |
startTime =new Date.today().add(-18).years(); | |
endTime =new Date.today().add(-70).years(); |
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
function makeid() | |
{ | |
var text = ""; | |
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |
for( var i=0; i < Math.random() * possible.length; i++ ) | |
text += possible.charAt(Math.floor(Math.random() * possible.length)); | |
return text; | |
} |
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 | |
NOW=$(date +"%m-%d-%Y") | |
FILE="hosts.$NOW.txt" | |
cp /etc/hosts /opt/bckups/$FILE | |
if [ -z "$1" ]; | |
then | |
echo "" > /opt/bckups/tmpList | |
sed '/facebook.com/d;/vk.com/d' /etc/hosts >> /opt/bckups/tmpList |
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
# replaces a string with another string | |
# @param string source string | |
# @param string search string | |
# @param string replacement string" | |
# usage: result="$(str_replace "foo bar" "foo" "hi")" | |
function str_replace() | |
{ | |
[ -z "$1" ] && return 1 | |
[ -z "$2" ] && return 1 |
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
Show hidden characters
"settings": | |
{ | |
"build_on_save": 1 , | |
"from_to_onsave" : | |
{ | |
"first" : { | |
"from" : "from" , | |
"to" : "[email protected]:/to" | |
} | |
} |
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
chrome.contextMenus.create({ | |
"title": "Extract Profile", | |
"contexts": ["page", "selection", "image", "link"], | |
"onclick" : function (info, tab) { | |
console.log(info); | |
console.log(tab); | |
} | |
}); | |
var clickHandler = function(e) { |
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/sh | |
service apache2 start | |
service mysql start | |
rm -fR /var/www | |
ln -s $(pwd)/www/ /var/www |
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/sh | |
ln -s $(pwd)/config/sublime-text-2 /root/.config/sublime-text-2 | |
ln -s $(pwd)/bin/sublime /opt/sublime | |
/opt/sublime/sublime_text | |
rm /root/.config/sublime-text-2 | |
rm /opt/sublime |
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
apt-get mercurial | |
#last BT it is MustHave | |
apt-get install python-software-properties | |
# | |
add-apt-repository ppa:tortoisehg-ppa/releases | |
apt-get install tortoisehg |