Over at http://fepus.net/ruby1line.txt you can find an awesome collection of ruby 1-liners. Here are some samples:
# align all text flush right on a 79-column width
$ ruby -ne 'printf("%79s", $_)' < file.txt # center all text in middle of 79-column width $ ruby -ne 'puts $_.chomp.center(79)' < file.txt $ ruby -lne 'puts $_.center(79)' < file.txt # substitute (find and replace) "foo" with "bar" on each line $ ruby -pe 'gsub(/foo/, "bar")' < file.txt # substitute "foo" with "bar" ONLY for lines which contain "baz" $ ruby -pe 'gsub(/foo/, "bar") if $_ = /baz/' < file.txt # substitute "foo" with "bar" EXCEPT for lines which contain "baz"
$ ruby -pe ‘gsub(/foo/, “bar”;) unless $_ =~ /baz/‘ < file.txt
still not working for me…
85.180.35.xxx – - [06/Aug/2008:16:28:42
0700] "GET / HTTP/1.1"; 200 7678 "" "WordPress/1.1 CFNetwork/337 Darwin/9.3.1";
85.180.35.xxx – - [06/Aug/2008:16:29:17
0700] "GET /xmlrpc.php HTTP/1.1"; 200 588 "" "WordPress/1.1 CFNetwork/337 Darwin/9.3.1";
If you end up getting this error message:
The path "/usr/src/linux/include"; is a kernel header file directory, but it
does not contain the file "linux/version.h"; as expected. This can happen if
the kernel has never been built, or if you have invoked the "make mrproper";
command in your kernel directory. In any case, you may want to rebuild your
Install kernel headers via:
sudo apt-get install linux-headers-`uname -r`
Do this (get YOUR_KERNEL_VERSION by doing uname -r):
# cd /usr/src/kernels/YOUR_KERNEL_VERSION/include/linux
- cp utsrelease.h version.h
and it should work :)
Woohoo, my Macbooks internal HDD (Hitachi Deathstar… oh… I'm sorry… Hitachi Deskstar) somehow broke. While browsing the net, everyhing froze and I had to reboot. Rebooting resultet in a "couldn't read yadda yadda"; message after 20 seconds and nothing happened after that, it just looped.
It wasn't a headcrash, it was just… well… I don't really know what it was, something broke and I'll get a new HDD :).
Anywhoooooo, luckily I've got a nice 750 GB HDD on my Airport Extreme which my macbook pushed Timemachine backups to until the bitter end. I used the backup made 2 hours before the disc went down the crapper and restored it on a 60 GB 2,5" SATA disc I still had in an external enclosure (1,3 GB of the 60 GB are still free).
What can I say, everything worked 0_o
I'm still searching for things that don't work, but so far, everything is there. The only thing that's missing is the Spotlight-index which is being rebuilt as we speak (wouldn't make any sense backing the index up anyway…)
Thanks to Pat for pointing me at refcardz
As they like to call it "FREE Cheatsheets for Developers";.
4-5 Pages of free PDF giving you an overview of a lot of topics, starting from Ajax, continuing at Windows Power shell and also covering topics such as Design Patterns.
Go get'em while they're hot! :D
p.s. if you don't want to click though all of those sites to get them all, I might be able to share it in wua.la ;)
(T-Mobile simply sent it back and said "It's working fine";)
presented at the Library of Congress, June 23rd 2008. This was tons of fun to present. I decided to forgo the PowerPoint and instead worked with students to prepare over 40 minutes of video for the 55 minute presentation. This is the result.
more info: http://mediatedcultures.net
0:00 Introduction, YouTube's Big Numbers
2:00 Numa Numa and the Celebration of Webcams
5:53 The Machine is Us/ing Us and the New Mediascape
12:16 Introducing our Research Team
12:56 Who is on YouTube?
13:25 What's on Youtube? Charlie Bit My Finger, Soulja Boy, etc.
17:04 5% of vids are personal vlogs addressed to the YouTube community, Why?
17:30 YouTube in context. The loss of community and "networked individualism"; (Wellman)
18:41 Cultural Inversion: individualism and community
19:15 Understanding new forms of community through Participant Observation
21:18 YouTube as a medium for community
23:00 Our first vlogs
25:00 The webcam: Everybody is watching where nobody is ("context collapse";)
26:05 Re-cognition and new forms of self-awareness (McLuhan)
27:58 The Anonymity of Watching YouTube: Haters and Lovers
29:53 Aesthetic Arrest
30:25 Connection without Constraint
32:35 Free Hugs: A hero for our mediated culture
34:02 YouTube Drama: Striving for popularity
34:55 An early star: emokid21ohio
36:55 YouTube's Anthenticity Crisis: the story of LonelyGirl15
39:50 Reflections on Authenticity
41:54 Gaming the system / Exposing the System
43:37 Seriously Playful Participatory Media Culture (featuring Us by blimvisible: http://www.youtube.com/watch?v=_yxHKg…
47:32 Networked Production: The Collab. MadV's "The Message"; and the message of YouTube
49:29 Poem: The Little Glass Dot, The Eyes of the World
51:15 Conclusion by bnessel1973
52:50 Dedication and Credits (Our Numa Numa dance)