See All CRON Tasks On Your Server At Once

Howdy Folks,
Here’s another little tip I picked up on the internet that helped me out in a big way. If you ever find yourself in need of seeing a list of CRON tasks for every user on your linux server, you can run the code below:

for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done

I find this especially helpful moving websites to completely new servers, as you never know what little helpers have been setup for seemingly innocuous tasks.

Love, peace, and cheese.

Code Snippets: Sudo Your Last Command [NSFW]

Hey Guys and Gals,
Here’s a little snippet I find handy whenever I’m working on the command line, forget to sudo, and feel like an idiot. Throw this badboy in your .bashrc (or .profile for you mac nerds):

# i'm an idiot
alias fuck='sudo $(history -p \!\!)'

And that’s it! Now when you forget to sudo with a complicated command, you can just type ‘fuck’ and throw in your password. Don’t forget to source your .bashrc once you’re done. I can’t take original credit for this, but it’s been I’ve used it for so long, I’m not sure where I originally came across it. If you happen to know, throw it in the comments below!

Later Skaters,