
flickr/romkey




Categories
Tags
Ajax amazon apple bat blogs browser chrome Code computers david foster wallace emacs Entertainment feed feedcache fitness Food in memoriam ios iphone ipod itunes leopard Life mac macintosh macos x Music nutrition pets raspberry pi recipe security sidebar simplify software taxes toilet TV UNIX uvfood web Wordpress world of warcraft writers wtfMeta
Tag Archives: UNIX
Use sudo Without a Password on Your Mac
Usually you’ll use it to execute a single command: sudo dmesg or to start a shell: sudo -s sudo is similar to the su command – the su command also allows you to become another user (most likely root). … Next, load /etc/sudoers in your favorite text editor, and add a line to it that looks like this: USERNAME ALL=(ALL) NOPASSWD: ALL Replace USERNAME with your short username (so in my case, my username is romkey or johnromkey rather than ‘John Romkey’ ). You can find your username with the who command – but if you don’t already know what it is or who to find it, you probably shouldn’t be disabling passwords on sudo in the first place. … There are other ways to do this (in particular, there are ways to say that anyone in a particular UNIX group can become use sudo without a password), but this is the simplest way to let a single user do this. Continue reading
Showing a Column as a UNIX Timestamp in MySQL
While MySQL has quite an assortment of date and time formats which it supports, I usually find it most convenient to store timestamps as an INT and just put the UNIX seconds since the epoch value in there. … A drawback is that sometimes when I’m working with the database by hand it’s annoying to see the timestamps as big numbers – sometimes it would be very helpful to see them as dates and times. … The “FROM_UNIXTIME()” function will interpret a numeric column’s value as a UNIX seconds-from-the-epoch value and show it as a date and timestamp. Using it I can easily do things like: SELECT URL, FROM_UNIXTIME(Timestamp) FROM AccessLog; and see it as: +—————————+————————–+ | URL | FROM_UNIXTIME(timestamp) | +—————————+————————–+ | explore/users/94 | 2008-10-05 22:49:39 | +—————————+————————–+ rather than +—————————+————+ | URL | timestamp | +—————————+————+ | explore/users/94 | 1223261379 | +—————————+————+ Continue reading