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
# pull the kali docker | |
docker pull kalilinux/kali-linux-docker | |
# run the container | |
docker run --interactive --tty --network=host --privileged --name=kali kalilinux/kali-linux-docker bash | |
# install top 10 tools https://www.kali.org/news/kali-linux-metapackages/ | |
apt update && apt install kali-linux-top10 |
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
// open with html string | |
function openPopupWin (content, width, height) { | |
var w = innerWidth || document.documentElement.clientWidth || screen.width | |
var h = innerHeight || document.documentElement.clientHeight || screen.height | |
var position = 'scrollbars=yes,width=' + width + ',height=' + height | |
position += ',top=' + ((h - height) / 2 + screenTop || screen.top || 0) | |
position += ',left=' + ((w - width) / 2 + screenLeft || screen.left || 0) | |
var popupWin = window.open('about:blank', '', position) | |
popupWin.document.write(content) |
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
// browser | |
console.log('%c Fucking hell! ', 'background: #222; font-size: 42px; color: #ff0000'); | |
// nodejs | |
console.log('\x1b[36m%s\x1b[0m', info); //cyan | |
console.log('\x1b[33m%s\x1b[0m: ', path); //yellow | |
//Here is reference of colors and other characters: | |
Reset = "\x1b[0m" | |
Bright = "\x1b[1m" |
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
######## PROMPT ######## | |
# export PS1="\[\e]0;\W\a\]\n\[\e[32m\]➜\[\e[m\] \[\033[1;36m\]\W\[\033[0m\] $(__git_ps1) " | |
# $ \[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__g it_ps1`\[\033[0m\]\n$ | |
if test -f /etc/profile.d/git-sdk.sh | |
then | |
TITLEPREFIX=SDK-${MSYSTEM#MINGW} | |
else | |
TITLEPREFIX=$MSYSTEM | |
fi |
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
function moveCursorToEnd(el) { | |
if (typeof el.selectionStart == "number") { | |
el.selectionStart = el.selectionEnd = el.value.length; | |
} else if (typeof el.createTextRange != "undefined") { | |
el.focus(); | |
var range = el.createTextRange(); | |
range.collapse(false); | |
range.select(); | |
} | |
} |
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
switch (operation) { | |
case "fromPercentage": // what is 5% of 20 ? 1 | |
var totalValue = a / 100 * b; | |
break; | |
case "toPercenrage": // 25 is what percent of 50 ? 50% | |
var totalValue = a / b * 100; | |
break; | |
case "diffPercentage": // from 20 to 50 ? 150% | |
var totalValue = (b - a) / a * 100; | |
break; |
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
### get all branch | |
git branch -a | grep -v HEAD | perl -ne 'chomp($_); s|^\*?\s*||; if (m|(.+)/(.+)| && not $d{$2}) {print qq(git branch --track $2 $1/$2\n)} else {$d{$_}=1}' | csh -xfs | |
#### GET URL FROM LOCAL REPO | |
git config --get remote.origin.url | |
#### change git remote url | |
git remote set-url origin https://github.com/USERNAME/OTHERREPOSITORY.git | |
git clone -b betav1 [email protected]:krishontreat/pain_diary.git |
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
.flip { | |
-moz-transform: scaleX(-1); | |
-o-transform: scaleX(-1); | |
-webkit-transform: scaleX(-1); | |
transform: scaleX(-1); | |
filter: FlipH; | |
} |
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
#!/bin/bash | |
ps -ef | egrep "node.+app.js" > /dev/null | |
if [[ $? -ne 0 ]]; then | |
pm2 start 2 // node process manager | |
echo "`date` : app started." >> ~/app.log | |
fi | |
# cron | |
*/5 * * * * /home/user/bin/node_app.sh | |
#---------------------- |
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
//<input type="text" id="txt" onkeyup="return forceLower(this);"/> | |
function forceLower(strInput) | |
{ | |
strInput.value=strInput.value.toLowerCase(); | |
} |