• About

Bespoke Blog

~ Science! Culture! Computational Engines!

Bespoke Blog

Tag Archives: UNIX

Data Recovery For The Very Lazy

16 Saturday Jul 2011

Posted by bwkeller in computer science, howto

≈ 2 Comments

Tags

bash, sleuthkit, UNIX

After my friend rm’d a bunch of code yesterday, I offered to help.  I first made a copy of her disk using dd, copying it off of her machine and using ssh to take it to another:


sudo dd if=/dev/sda1 | ssh USER@HOST "dd of=/home/USER/backup.img"

I then grabbed a copy of sleuthkit, and used the fls tool to find the inodes pointing at her old files, and icat to restore them.  I new the files were php code, stored in /var/www so I used grep to select those results from all the files listed by fls.  Using grep, I selected the inode numbers from the output, and piped the results to icat.


for i in `fls -r -d backup.img | grep var/www | grep \.php | grep -o [0-9][0-9]*`

do

icat $i > $i

done

Voila, I had a bunch of files, 6 of which were the missing PHP files!  Super easy, and thank goodness the filesystem was ext2, as ext3 is much harder to recover data from.

rm Is Not Your Friend

16 Saturday Jul 2011

Posted by bwkeller in computer science, howto, research

≈ 4 Comments

Tags

bash, UNIX

This afternoon, about 10 minutes before the end of the day, one of the undergrads working in my lab turned to me and asked what the command to undo an rm command was.  I blinked at her, and told her there was none.  I’m now trying to sift through a disk image dumped from the machine she worked on after typing rm -r * in the wrong terminal.  Now, backups, backups, etc. I know.  But even with regular backups, an rm -r * in your home directory is never fun.  If you want to not experience the joys of watching your files turn to dust, add this to your .bashrc:


alias rm="rm -i"

This won’t save you every time, but it will at least prompt you before you blow away 3 weeks of work.  So don’t ignore the prompt. Please?

Was it good for you, too?

13 Friday Feb 2009

Posted by nfitzgerald in computer science

≈ 1 Comment

Tags

time, UNIX

(follow up to this)

1234567890

OH-EM-GEE: An Epoch to Remember

10 Tuesday Feb 2009

Posted by nfitzgerald in computer science

≈ 3 Comments

Tags

computer science, time, UNIX

Drop what you’re doing and pay attention: The Interwebs have just informed me of something spectacular. Just over 70 hours from this moment, UNIX time will read 1234567890. Watch the countdown here. As far as I can figure this is the last “cool” time we will see before the “Unix Millenium Bug” in 2038.

January 2023
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
3031  
« Mar    

Ben’s Tweets

  • RT @OJ_Astro: A blog post by physicist Syksy Räsänen (@SyksyRasanen), who has published with us twice, about why overlay journals are an an… 1 day ago
  • RT @JokesAstro: If the Islands of Hawaii were very massive stars, Kauai would be going supernova soon. https://t.co/NEboP6FRWd 2 days ago
  • RT @AnicaSeelie: @gauravmunjal Imagine if there was a duck but it had human ears 2 days ago
  • RT @jfmclaughlin92: Friendly reminder that if you're at a public university, your institutional email can be searched basically whenever. B… 2 days ago
  • @rcrain_astro Academia has a lot of problems. Precarious employment, massive overworking of junior researchers, poo… twitter.com/i/web/status/1… 2 days ago

Nicholas’ Tweet’s

  • RT @michielsdj: New paper! Retrieval-augmented models are expensive. Make them faster by partially pre-computing passage representations. W… 5 days ago
  • RT @michielsdj: New paper! We propose FiDO, an improved version of Fusion-in-Decoder with faster inference and better performance. Work don… 1 month ago
  • @_julianmichael_ @LukeZettlemoyer @emilymbender @nlpnoah @ssshanest Congrats! 5 months ago
  • RT @michielsdj: Now accepted to @iclr_conf! 🎆 1 year ago
  • @mjskay Yeah, I feel a major point people were missing is that an endless spiral into the drain is actually the perfect visual metaphor. 1 year ago

Top Posts

  • Basic Data Plotting with Matplotlib Part 3: Histograms

Tags

100daychallenge advertising astronomy bash biology blogs BMC books browsers Bulshytt calligraphy canada coding cognitive computers computer science css EEE elvish ereaders ethics evolution experiments facebook google government html humor humour ICP I hate this class iliad internet explorer irex java javascript lego letter libraries marketing materialism matplotlib maze mindstorms mods morality mysql networking neuroscience pens philosophy philsophy php Pilish prime minister programming psychology reading review robots science SENG servers sociology steampunk stupid technology time ubc UNIX url vim web web design writing

Blogs We Read

  • Bad Astronomy
  • Boing Boing
  • Rationally Speaking
  • Terry Project (UBC)

RSS Nicholas’ Terry Posts

  • An error has occurred; the feed is probably down. Try again later.

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 162 other subscribers

Blog at WordPress.com.

  • Follow Following
    • Bespoke Blog
    • Join 74 other followers
    • Already have a WordPress.com account? Log in now.
    • Bespoke Blog
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...