Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # General, all-around cheat sheet
- Things I don't remember offhand and have to look up. Now they're all in one place.
- ## Command line
- Make a file executable
- ```
- chmod +x [file path]
- ```
- Copy a file
- ```
- cp [original file path] [new path]
- ```
- Move a file
- ```
- mv [original file path] [new path]
- ```
- SSH
- ```
- ssh [username]@[host IP or domain] -p [port]
- ```
- ## MySQL
- Dump a database
- ```
- mysqldump -h [host IP] -P [port] -u [db user] -p[db pass] [db name] > [local file path].sql
- ```
- #### Wordpress
- Create user in Wordpress database
- ```
- INSERT INTO `[db-name]`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`, `display_name`) VALUES ('1000', 'tempuser', MD5('Str0ngPa55!'), 'tempuser', 'support@wpwhitesecurity.com', '0', 'Temp User');
- ```
- Make user an admin
- ```
- INSERT INTO `[db-name]`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '1000', 'wp_capabilities', 'a:1:{s:13:"administrator";b:1;}');
- INSERT INTO `[db-name]`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '1000', 'wp_user_level', '10');
- ```
- ## Git
- Change remote URL
- ```
- git remote set-url [remote name] [URL]
- ```
- Undo a commit while keeping changes to files
- ```
- git reset --soft HEAD [file path]
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement