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
| RewriteEngine on | |
| RewriteRule ^(.*)$ https://example.com/$1 [R=301,L] |
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
| # find all .env files and store in env_files.txt | |
| find . -name \.env -type f > env_files.txt | |
| # find oldstring in these files | |
| for i in `cat env_files.txt`;do | |
| grep -i "oldstring" $i | |
| done | |
| # find oldstring just with grep and no list of files | |
| grep -ir --include \.env "oldstring" |
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
| grep -irobUaP "\x00" * |
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
| UPDATE wp_options SET option_value = replace(option_value, 'oldurl.com', 'newurl.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
| UPDATE wp_posts SET guid = replace(guid, 'oldurl.com','newurl.com'); | |
| UPDATE wp_posts SET post_content = replace(post_content, 'oldurl.com', 'newurl.com'); | |
| UPDATE wp_postmeta SET meta_value = replace(meta_value,'oldurl.com','newurl.com'); |
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 reflog expire --all --expire=now | |
| git gc --prune=now --aggressive |
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
| -- select database first, update ID '999' 3x below, update user and password xxxxxxxxxxxxxxxx also | |
| INSERT INTO `wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('999', 'demo', MD5('xxxxxxxxxxxxxxxx'), 'Your Name', 'test@example.com', 'http://www.test.com/', '2020-05-15 00:00:00', '', '0', 'Your Name'); | |
| INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '999', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}'); | |
| INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '999', 'wp_user_level', '10'); |
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
| # split a file into 1GB chuncks foo.000 foo.001 etc. | |
| split -b 1GB -d -a 3 my.tar.gz foo. | |
| # to compare | |
| md5sum my.tar.gz | |
| # stitch files back together | |
| cat foo.* > my.tar.gz | |
| # stitch files back together (more specific) | |
| cat foo.{000..012} > my.tar.gz |
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
| cat file.log | mail -s "subject.." my@example.com |
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
| find . -type f -exec chmod 644 {} \; | |
| find . -type d -exec chmod 755 {} \; |
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
| mv foo foo2 | |
| git add -A | |
| git commit -m "renaming" | |
| mv foo2 FOO | |
| git add -A | |
| git commit --amend -m "renamed foo to FOO" |
NewerOlder