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 | |
cd /tmp || exit | |
echo "Downloading Postman ..." | |
wget -q https://dl.pstmn.io/download/latest/linux?arch=64 -O postman.tar.gz | |
tar -xzf postman.tar.gz | |
rm postman.tar.gz | |
echo "Installing to opt..." | |
if [ -d "/opt/Postman" ];then | |
sudo rm -rf /opt/Postman |
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
IN node | |
use path.resolve("./data/faf") | |
for cross compatibality of path in windows and linux |
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
wget -r -np -nH --cut-dirs=3 -R index.html http://hostname:port | |
Explanation: | |
It will download all files and subfolders in ddd directory | |
-r : recursively | |
-np : not going to upper directories, like ccc/… | |
-nH : not saving files to hostname folder | |
--cut-dirs=3 : but saving it to ddd by omitting first 3 folders aaa, bbb, ccc | |
-R index.html : excluding index.html files |
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
Go to the folder open terminal | |
On node | |
sudo http-server -a 0.0.0.0 -p 889 | |
On python | |
sudo python -m http.server 889 |
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
ps ax|less #show running processes search process using /process name | |
kill unresponsive programs | |
pidof PROGRAMNAME | |
kill $pidof | |
OR even better | |
kill $(pidof konsole) | |
eve better if killall node works | |
nice and renice to check/change priority | |
All list of tools related to system performance http://www.brendangregg.com/linuxperf.html | |
To check how much time a process is taking to finish |
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 config --global color.ui auto | |
Advanced Git Cheat Sheet | |
git commit -a Stages files automatically | |
git log -p Produces patch text | |
git show Shows various objects | |
git diff Is similar to the Linux `diff` command, and can show the differences in various commits | |
git diff --staged An alias to --cached, this will show all staged files compared to the named commit | |
git add -p Allows a user to interactively review patches to add to the current commit | |
git mv Similar to the Linux `mv` command, this moves a file |
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
https.get('https://www.bs.com/dfsd/fsdf/d-quotes'.replace(/[^\x00-\x7F]/g, "") |
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
Redirections, Pipes and Signals | |
Managing streams | |
These are the redirectors that we can use to take control of the streams of our programs | |
command > file: redirects standard output, overwrites file | |
command >> file: redirects standard output, appends to file | |
command < file: redirects standard input from file | |
command 2> file: redirects standard error to file | |
command1 | command2: connects the output of command1 to the input of command2 |
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
//Clearly Parsing occurs before execution else "greeting" should have consoled same is reason behind for Hoisting | |
var greeting = "Hi"; | |
console.log(greeting); | |
greeting = ."Hello"; //Syntax error is thrown first |
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 range(start,end) { | |
if(start&&end){ | |
return Array.from({length:end-start+1},(_,i)=>start++) | |
} | |
else{ | |
return function range2(end){ | |
return Array.from({length:end-start+1},(_,i)=>start++) | |
} | |
} |
NewerOlder