Creating Hierarchical User Permissions Tutorial

May 11th, 2010

Dealing with multiple users on a single box can be frustrating at first. Especially when they edit the same files. I wanted to create a sort of hierarchy of users with my root and personal accounts at the top, and a pool of sub-accounts below. Here’s how I solved this problem in Ubuntu:

First, create a common group:

groupadd <group-name>

Next, make sure all of the sub-accounts use the new group as its default account.

For new users:

useradd -G <group-name> <username>

For existing users:

usermod -a -G <group-name> <username>

When a user creates a file or directory, they normally would use their own group. What we want is that any account in the common group to use the new group as its default:

usermod -g <group-name> <username>

Last, change the sub-users’ default umask settings so that it treats its own settings exactly the same as the group settings. Make sure to only run this command as one of the sub-accounts:

umask 0002

Now you have a list of accounts with limited permissions that your main account will always have access to. Now this is not an optimal, and probably secure solution, but since this only for my development environment, its good enough.

linux, programming , , , , , ,

NerdTree: Vim Plugin For IDE Style File Editing

April 23rd, 2010

I’ve always been a big fan of VSTreeExplorer since I started using Vim. Recently, I came across NerdTree, which is a much better alternative. It really makes it much easier to manage multiple tabs and sessions and has many more keybindings and mouse interactions making it the closest to the Visual Studios experience in Vim. Here’s a really good animated gif with a basic tutorial on its use:

linux, programming, technology , , , , , ,

Google Chrome History Search

March 23rd, 2010

If you needed a reason to switch to Google Chrome, I just found one more. Go to your chrome history by typing Ctrl+H or going through Tools -> History. Type in any text you remember reading throughout your viewing history and chrome will do a regular google search through your history. I’ve always wanted to build this feature into Firefox, but now I don’t have to. Now the only thing chrome needs for me to be a full convert is Tree Style Tabs.

google, internet , , , , , ,

IOTop: Monitor Program’s Disk Input/Output

January 20th, 2010

Top and especially HTop are really useful tools for monitering system resources. The thing I always found lacking was the amount of disk io (input/output) attributed to a particular process. Recently, I found a pretty cool tool that does just that: . It display disk the amount of reads and writes per second and also swap and io percentage if the CONFIG_TASK_DELAY_ACCT setting is enabled in the kernel.

misc

Pure Linux DVD Ripping

April 10th, 2009

Whenever I wanted to rip DVD’s for longterm storage, I’ve always used Wine + DVDShrink. I just now discovered a pure linux program, Handbrake, for ripping DVD’s and so far, it has worked out really well This article does a really good job explaining it. Merry Ripping!

linux , , , , ,

Ubiquity: the web made cool again

March 11th, 2009

If you haven’t heard about Ubiquity, I advise you to check it out. It’s a great Firefox plugin that allows basically any service to be at your disposal. The basic premise is you highlight some words, start typing an action, and it will find a service that meets your needs. Check out the video below for a better explanation. Watch out for a Grooveshark command later on.

This movie requires Flash Player 9

programming, technology, video, web , , , ,

Recursions in the Sky

December 13th, 2008

The most fascinating concept in computer science has to be recursion. Even when it’s not its pure form, recursion is just a beautiful concept:

A programming technique in which a program or routine calls itself to perform successive steps in an operation, with each step using the output of the preceding step.

It might not be the most efficient or the fastest way to do things, but it’s just damn cool. Some cool uses for them are quines, computing Fibonacci numbers and fractals.

Fractals and Fibonnaci numbers, along with the golden ratio, can be found in numerous places in nature. Tree branches and roots grow in a vary fractal nature. The spiral of a sea shell is dominated by the golden ratio. If you look closesly, recursive properties are found all over the universe.

I’ve known this link between recursion and nature for a while but this past summer, a co-worker at Grooveshark, Chris, and I have had many discussions about math and science. He revealed to me an idea of his that the universe is made of many self-similar structures: sub-atomic particles, atoms, solar systems, galaxies and even the mega structures of the universe. His goal is to describe the basic laws of physics using a fractal model. While this idea seems really crazy, I really like it because fractals have shown that very simple equations can describe very complex behavior (see Chaos theory).

A while back, I read an article describing evidence that the universe appears to be fractal at certain scales. Currently, there is no theory to describe why this occurs and due to the limitations of modern technology, scientists cannot prove this observation at larger scales. Despite these limitations, I really do believe there might be something “fractal” behind the basic structures of the universe. Here’s a really uncanny picture proving this point. While there are many theories trying to bridge the gap between quantum theory and relativity, only string theory and its variations have come close. While I wait for Chris to finish his fractal model of physics, here’s some cool recursive and fractal music to check out:

math, science , , , , , , , ,

Netflix Entry 1: Test runs

December 8th, 2008

I decided for my first 2 entries into the Netflix prize, I would see just how good/bad current scores are. For those who have never heard of the Netflix prize, see my post here.

First, I will predict a 3 for every rating just to see how much deviation there really is from that average ranking. And for my second submission, I just use a random number between 1 and 5 to see how well a random prediction fares with the rest of the leaderboard. After setting those two scripts up and submitting, I never got back a score. I’m not that dissappointed but maybe they saw that i was just sending them random/constant data and decided I was not worth their time. Made me feel kinda sad…

Also, I was having some difficulties initially writing my script in python, so I decided to just hurry up and do it in PHP and then port it python later. The first thing i noticed between the two scripts was just how much faster python is than php. I ran each script three times and calculated the averages. Below are the results:

Language Script Time
Python Constant 30.037 seconds
PHP Constant 40.388 seconds
Python Random 9.312 seconds
PHP Random 19.464 seconds

I know I’m probably beating a dead horse here but python is WAY faster. And nothing really intensive or complex is going on here: string concatenation, random number generation, and writing to a file. That is it. Python performs the constant value prediction ~50% faster and the random value prediction ~25% faster.

As I get more comfortable with python and its vast library of scripts, it will definitely become my goto scripting language. For all you Ruby enthusiasts, especially you, Travis, the ruby language is very well thought out, but until anybody can come close to NumPy/SciPy, I will stick to python for now.

Netflix, linux, math, programming

SEC Championship: Bring It On!

December 5th, 2008

I just received this “question” from the Grooveshark contact page:

Name: Big Al
Question: Roll Tide!!!

Now being the good-sport that I am, I really love the enthusiasm. Especially the fact they actually thought it was worth their time to send me that message. This Saturday at 8pm, the SEC college football championship game will be played in Atlanta. I went the last time UF won it in 2006 and Atlanta is a really fun city, especially Peachtree Rd in Buckhead (funny enough, its really near the EspnZone).

misc

Football and Statistics Unite!

December 4th, 2008

Being a huge football fan and nerd, I love it when the two actually combine. There’s no need for brawn vs brain, or jocks vs geeks. In a perfect world, they can live together. Here are some sites that I’ve found that do a great job marrying the two:

Saurian Sagacity: With a major Florida Gator bias, this blog always have an interesting way of looking at football with great stats to back it up. My favorite post is when he absolutely calls out Texas Tech, and every other team, for not having a defense worthy of stopping anybody.

Smart Football: They are the most focused on X’s and O’s of any of the sites. They really go into how and why certain formations, plays or schemes succeed. The latest post is an absolute gem detailing exactly why the Florida Gators offense is so successful. But he also p0wnz my hometown Auburn Tigers for being the exact opposite of good on offense this year.

Advanced NFL Stats: Geared towards the NFL, they always have really statistically oriented posts. This post on signal vs noise in stats and how they correlate to wins is especially intriguing.

BCS Guru: For not being very mathematically or schematically involved, this site always stay on top of the lunacy that is the BCS. This mailbag-style post really goes into the sheer wackiness of the BCS, and the Big 12 South this year.

Dr Saturday: This is the most entertaining site and also contains the best writing. This Yahoo! blog started out as the best college football blog in the world: Sunday Morning Quarterback. But like most people in his position, he decided to take more money and a larger audience and moved on to bigger and better things leaving behind his absolutely hilarious, yet informative pre-season previews. Despite not having as much of a statistical bent towards his stories nowadays, Dr. Saturday still produces great articles.

Now here’s some football music for your listening pleasure (thanks to Groovshark):

auburn, college football, math , , , , , , , , , , , , , , , , ,