DEVTOME.COM HOSTING COSTS HAVE BEGUN TO EXCEED 115$ MONTHLY. THE ADMINISTRATION IS NO LONGER ABLE TO HANDLE THE COST WITHOUT ASSISTANCE DUE TO THE RISING COST. THIS HAS BEEN OCCURRING FOR ALMOST A YEAR, BUT WE HAVE BEEN HANDLING IT FROM OUR OWN POCKETS. HOWEVER, WITH LITERALLY NO DONATIONS FOR THE PAST 2+ YEARS IT HAS DEPLETED THE BUDGET IN SHORT ORDER WITH THE INCREASE IN ACTIVITY ON THE SITE IN THE PAST 6 MONTHS. OUR CPU USAGE HAS BECOME TOO HIGH TO REMAIN ON A REASONABLE COSTING PLAN THAT WE COULD MAINTAIN. IF YOU WOULD LIKE TO SUPPORT THE DEVTOME PROJECT AND KEEP THE SITE UP/ALIVE PLEASE DONATE (EVEN IF ITS A SATOSHI) TO OUR DEVCOIN 1M4PCuMXvpWX6LHPkBEf3LJ2z1boZv4EQa OR OUR BTC WALLET 16eqEcqfw4zHUh2znvMcmRzGVwCn7CJLxR TO ALLOW US TO AFFORD THE HOSTING.

THE DEVCOIN AND DEVTOME PROJECTS ARE BOTH VERY IMPORTANT TO THE COMMUNITY. PLEASE CONTRIBUTE TO ITS FURTHER SUCCESS FOR ANOTHER 5 OR MORE YEARS!

Changing File Permissions with tar

This is a neat experiment I came across a while ago. It's useful as one of those “pull someone out of the fire” situations that you keep in your back pocket for when someone comes running asking for help.

Most users know chmod. Anyone who has used chmod would recognize the kind of situation chmod a-x /usr/bin/chmod puts your in. It's akin to burning a bridge behind you. It's a catch 22. You are changing the mode (specifically you are removing the execute permission) for the utility that changes file modes. After performing the change you would be left unable to change chmod back - its executable permission is gone!

 # chmod a-x chmod
 # chmod
 -bash: /bin/chmod: Permission denied

What do you do?

Well, there are a few things, actually. First you could just invoke python or perl or some other language that has the ability to change file permissions. Second you could just re-install chmod. My first impulse when I originally saw this problem was “Just flip the mode bit” but that's not as elegant as it sounds.

My solution is to use tar. It's pretty safe to assume your distro has tar.

 # tar --mode 0777 -cf test.tar /usr/bin/chmod
 # tar -xvf test.tar

Will net you a free chmod with 777 permissions.

 # tar --mode 0777 -cf test.tar chmod
 # tar -xvf test.tar
 chmod
 # ls -la chmod
 -rwxrwxrwx. 1 root root 51248 Oct  5  2011 chmod


QR Code
QR Code change_file_permissions_with_tar (generated for current page)
 

Advertise with Anonymous Ads