Advertisement
Guest User

Untitled

a guest
Apr 19th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. # General, all-around cheat sheet
  2.  
  3. Things I don't remember offhand and have to look up. Now they're all in one place.
  4.  
  5. ## Command line
  6.  
  7. Make a file executable
  8. ```
  9. chmod +x [file path]
  10. ```
  11.  
  12. Copy a file
  13. ```
  14. cp [original file path] [new path]
  15. ```
  16.  
  17. Move a file
  18. ```
  19. mv [original file path] [new path]
  20. ```
  21.  
  22. SSH
  23. ```
  24. ssh [username]@[host IP or domain] -p [port]
  25. ```
  26.  
  27. ## MySQL
  28.  
  29. Dump a database
  30. ```
  31. mysqldump -h [host IP] -P [port] -u [db user] -p[db pass] [db name] > [local file path].sql
  32. ```
  33.  
  34. #### Wordpress
  35.  
  36. Create user in Wordpress database
  37. ```
  38. 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');
  39. ```
  40.  
  41. Make user an admin
  42. ```
  43. 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;}');
  44.  
  45. INSERT INTO `[db-name]`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '1000', 'wp_user_level', '10');
  46. ```
  47.  
  48.  
  49. ## Git
  50.  
  51. Change remote URL
  52. ```
  53. git remote set-url [remote name] [URL]
  54. ```
  55.  
  56. Undo a commit while keeping changes to files
  57. ```
  58. git reset --soft HEAD [file path]
  59. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement