Find text or string in files of a certain type

Posted by & filed under Linux, Mac OS X.

One can use grep “mystring” myfile.ext to find the lines in myfile.ext containing mystring. One could also use grep “mystring” *.ext to find mystring in all files with extension ext. Similarly, one could use grep “mystring” /directory to search for mystring in all files in the directory. What if one wants to search for mystring… Read more »

Execute shell commands with an asterisk in SAS

Posted by & filed under Coding, Linux, SAS.

I wanted to use %sysexec to execute a shell command with an asterisk (shell wildcard for globbing) in a SAS program: %sysexec cp /tmp/foo/*.txt /tmp/bar ; However, it wasn’t giving me the desired results, probably due to the /* characters as they begin a commented section in a SAS program. Also tried escaping the asterisk… Read more »

Fixing group permissions in sshfs via OSXfuse

Posted by & filed under Linux, Mac OS X.

One could mount SSHFS partitions on a Mac OS X system via OSXfuse and MacFusion to access remote files securely as if the files were stored locally. However, group permission seems to not be preserved (get a permission denied message). This post shows how one could fix it by using the -o defer_permissions options.

Screen brightness after suspend in Ubuntu

Posted by & filed under Linux.

Many laptops have their screens dimmed after returning from “suspend” and cannot get back to their original brightness. The bug hasn’t been fixed for 3 years. A fix is provided in the bug report by putting something like the following in /etc/rc.local: brt=`cat /sys/devices/virtual/backlight/acpi_video0/brightness` abrt=`cat /sys/devices/virtual/backlight/acpi_video0/actual_brightness` if (( $brt != $abrt )) ; then echo… Read more »

Truly live Linux distribution on USB with Casper

Posted by & filed under Linux.

Many distros come with the ability to try or use the distro via a live session on USB or CD without installing it to disk. However, the live session starts fresh with every boot. I recently discovered Casper. It allows you to have a live session on USB with all work saved on USB.

Enable root account in Ubuntu?

Posted by & filed under Linux.

After my recent experience with broken su and sudo commands in a failed system upgrade, I realized that although disabling the root account has many advantages, one of the disadvantage is that I can’t login as root in the terminal when I’m physically in front of the system. This is a major issue if su,… Read more »