653 reputation
111
bio website
location Cairo, Egypt
age 25
visits member for 6 months
seen 30 mins ago
stats profile views 27

Electronic engineering major. Doing sysadmin stuff for lack of someone better.


1h
comment What happens when I press “Shut Down” from the GUI?
@don_crissti That much I now understand. What I'm interested in is precisely this "signal". What is the client that sends it?
4h
comment How to write a script to read wifi SSID and password from USB drive at boot up and auto logon to wifi network
@szielenski Third suggestion, if you're conversant with udev,save the Perl script on your thumb drive and write a udev rule that would mount your drive at a specified point and run the script off it as soon as it's connected.
4h
comment How to write a script to read wifi SSID and password from USB drive at boot up and auto logon to wifi network
@szielenski Another fun thing you might want to try: don't hardcode a mount point in the script at all. Only hardcode the thumb drive's UUID (which you can find through udevadm) crawl /sys (I'm guessing) to check whether a device with this UUID is connected to a USB port (so your script can bail sanely if it isn't) and if so, crawl /dev to determine whether it's mounted so you can mount it yourself if necessary.
5h
comment How to write a script to read wifi SSID and password from USB drive at boot up and auto logon to wifi network
+1 You might want to couple this with an entry in /etc/fstab to ensure your thumb drive is always mounted at the same mount point. I wouldn't rely on automounting for this because you may have some other USB stick plugged in that grabs the mount point you're relying upon.
9h
comment How to repair system if kernel panic?
@xliiv I'm sorry to report that I couldn't solve my libc issue and had to reinstall as @schaiba suggests.
9h
comment perl script explanation please
$word would be a word read from the file (this example seems to assume an input file with one word per line) and $occurrences would contain the number of times this word has occurred in the file because it's incremented every time the $word is encountered.
9h
comment perl script explanation please
Well $line++ by itself would do no good. It would actually produce a nonsensical value by "incrementing" the last character in the variable. Remember that $line actually contains the contents of the file's line not the line number. What is done here, is that the %count hash entry keyed by the contents of the $line variable is incremented (because the number of occurrences has increased by one) and created with a value of '1' if it didn't exist before.
10h
comment How to add a line from a list into another file when a specified line is found?
+1 Neat trick! I know this is rich coming from the guy who proposed a perl answer, but it feels a bit "write-only" :)
10h
revised How to add a line from a list into another file when a specified line is found?
edited body
10h
comment How to repair system if kernel panic?
@MichaelKjörling This doesn't necessarily point to faulty hardware. I faced a similar issue recently (though with Squeeze) after a forced reinstall of libc. chroot failed to execute bash.
11h
revised perl script explanation please
added 73 characters in body
11h
answered perl script explanation please
11h
revised Easy way to parse syslog date format
added 4 characters in body
11h
comment Easy way to parse syslog date format
Fixed. Thank you.
11h
comment Easy way to parse syslog date format
@l0b0 D'oh! Fixed. Thanks :)
11h
revised Easy way to parse syslog date format
added 4 characters in body
12h
comment How to add a line from a list into another file when a specified line is found?
Always a good idea...
12h
revised How to add a line from a list into another file when a specified line is found?
added 1 characters in body
12h
answered How to add a line from a list into another file when a specified line is found?
13h
revised How to prevent shutdown when an SSH user is logged in?
added 732 characters in body