2013
Previously, I wrote a script that automatically escalated to root permissions if needed.
This works fine for shell scripts, but recently I needed a way to do this for Python scripts. The trouble is that the shebang #! syntax only allows limited command-line argument passing.
This following recipe is not pretty, but it seems to work!
#!/usr/bin/env bash
if (( UID != 0 )); then
echo re-running as root
exec sudo -E "$0" "$@"
fi
python2 -u <(cat <<"EOF"
print "hello, world!"
EOF
) "$@"
2013
Oishinbo: Vol. 2, Sake **** : Another great installment of the Oishinbo series. This one focuses on wine and sake as they interact with Japanese cuisine.
2013
Oishinbo: Vol.1 Japanese Cuisine **** : I love this Japanese foodie series.
2013
Hyperion ***** : All four books in this serious are "big" science fiction: society, government, military, time and space travel, religion; it covers it all! (I read these last year but forgot to review them until now.)
2013
Room **** : Touching and creatively-written story of a mother and son's love for each other in a horrible situation.
2013
Oishinbo: Fish, Sushi, & Sashimi ***** : Delightful story of Japanese food culture.
2012
Player of Games ***** : Culture series, book 2. Even better than the first! About a master player in a game that determines who becomes emperor.
2012
Consider Phlebas **** : Great space opera with thorough backstory a la David Brin's Uplift series.
2011
Last month, Microsoft discontinued support for Windows Sidebar Gadgets. They didn't give developers any warning nor did they give users a chance to save copies of their favorite gadgets. It's a pretty short-sighted move in my opinion.
Here is a collection of alternative places to get gadgets. I wish Microsoft had kept a read-only copy of the gadget store online. But they didn't. So this is all we have left:
- http://www.thoosje.com/
- http://gadgetsforvista.net/ (full of ads)
- http://wingadget.ru/cat/novosti (in Russian, use Chrome translate!)
- http://torentilo.com/download/4668072/Windows-Sidebar-Gadgets-Mega-Pack%7Bh33t%7D%7Bmad-dog%7D.html (a torrent containing a huge collection of gadgets)
2011
I don't know why it took me so long to figure this out, but here is a nice little recipe for elevating a script to root permissions from inside the script.
#!/usr/bin/env bash
if (( UID != 0 )); then
echo Re-running as root
exec sudo -E "$0" ${1+"$@"}
fi
echo Script is running as root
echo Here are my arguments:
for i in "$@"; do echo arg=[$i]; done
id
If you don't want to export the user's environment variables, replace "sudo -E" with "sudo".
2011
Tunnel in the Sky **** : Classic Heinlein space-cowboy, coming-of-age, young-adult fiction.
2011
Manga Guide to Calculus **** : Even if you already know Calculus, this is still very enjoyable. The entire series looks appealing!
2011
Under the Dome ***** : Stephen King at his best, describing small-town America with a full cast of interesting characters.
Read more journal entries.
Sign up to receive e-mail updates from RssFwd whenever new content is available on this site.