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
# Remove row duplicates | |
SELECT DISTINCTROW * INTO doublettesTable FROM uniqueTable; | |
# Count column duplicates | |
SELECT col, count(*) AS cnt | |
FROM table | |
GROUP BY col | |
HAVING cnt > 1; | |
# Count duplicates with two cols |
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 | |
# configs | |
SSH_USR='myuser' | |
DIR_SRC='/update/directory' | |
# destinations | |
SERVER1[0]='custom-app1' | |
SERVER1[1]='custom-app2' | |
SERVER1[2]='custom-app3' |
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
<?php | |
class ConvertError2Exception | |
{ | |
/** | |
* Error string. | |
* Is null if there was no error | |
* | |
* @var string | |
*/ |
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
rsync -aWHvz --delete -e "ssh -i /home/user/.ssh/mykey" /path/to/source /path/to/destination |
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
# export | |
# cd /usr/local/bin/ | |
mysqldump -username -password databasename > /home/user/directory/databasename.sql | |
# import | |
mysqladmin -u username -p create databasename | |
# cd /usr/bin | |
mysql -u username -p databasename < /home/user/directory/databasename.sql |
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
# SQL-Injections | |
.*mysql_query\(.*\s*\$_(GET|POST|REQUEST|COOKIE)).* | |
# reflective xss | |
(echo|print).*\$_(GET|POST|COOKIE|REQUEST) |
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
<?php | |
$token = md5( | |
microtime() . | |
rand() . | |
serialize(shuffle($GLOBALS)) | |
); |
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
<?php | |
escapeshellcmd(); | |
escapeshellarg(); |
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
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
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
.DS_Store | |
Desktop.ini | |
.idea | |
*~ | |
*.swp | |
._* | |
*.pyc | |
Thumbs.db | |
.Spotlight-V100 | |
.Trashes |
OlderNewer