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
Combine searches | |
marathon OR race | |
Search for a specific site | |
site:.gov | |
site:uol.com | |
search parts of url | |
inurl:old "index of" "wp-config.php" |
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
#check the name of the minions | |
sudo salt-run manage.up | |
#update source for salt master. | |
sudo salt-run git_pillar.update | |
#check the state first. | |
sudo salt '*' state.apply test=True | |
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
SELECT order_id,product_name,qty | |
FROM orders | |
WHERE foo = 'bar' | |
INTO OUTFILE '/var/lib/mysql-files/orders.csv' | |
FIELDS TERMINATED BY ',' | |
ENCLOSED BY '"' | |
LINES TERMINATED BY '\n'; |
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
aws s3 sync . s3://<your_bucket> --profile <name_your_profile> |
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
var hello = "hello" | |
if (!hello.isEmpty) | |
print "is not empty" | |
var myHello = if (!hello.isEmpty) "is not empty" else "is empty" |
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
#insert user: | |
db.Client.insertOne( { | |
"id": "5788a5f71b2b6de0148b4567", | |
"name": "jonho", | |
"lastname": "dust" | |
}); | |
#show current table | |
db |
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
#send files to buckets | |
gsutil rsync -d -r <folder path> gs://<name of your bucket> | |
#change permission bucket | |
gsutil acl ch -u AllUsers:R gs://yourbucket/** |
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 | |
case "$1" in | |
"server1") echo "Connecting to server1" | |
sshpass -p 'your_passwd' ssh <user>@<ip_server> | |
echo "Connection closed with $1" | |
;; | |
"server2") echo "Connecting to server2" | |
sshpass -p 'your_passwd' ssh <user>@<ip_server> |
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
# Split a big file into multiples fiels | |
tail -n +2 file_name.csv | split -l 59000 - split_ | |
for file in split_* | |
do | |
head -n 1 file_name.csv > tmp_file | |
cat $file >> tmp_file | |
mv -f tmp_file $file | |
done |
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
sed -n '$=' $1 |
NewerOlder