2010-01-03, Sun

How to change file or folder permissions recursively with chmod

I needed to change all the php files in a web project to 644 when they were all actually set to 755, and all the folders to 755 when they were set to 700. Here’s how it’s done.

To set all the folders to 755:

    find . -type d -exec chmod 755 {} \;

To set all files to 644:

    find . -type f -exec chmod 644 {} \;

To set only files that end with .php to 755 (pattern escaped with slashes)

    find . -name \*\.php -exec chmod 644 {} \;

You get the idea. Basically, we’re using the find utility to pick out the files we’re wanting to work with, and executing chmod over them.

Isaac Su

tags: bash chmod find linux permissions recursive shell unix

Comment

---

2010-01-02, Sat

How to reuse windows when opening folders in Nautilus

One of the things that annoyed me about using Fedora 11 is the way the default filesystem browser behaved whenever you decided to enter a folder – it would automatically open a new file browser window.

This WILT shows you how to make Nautilus open the folder in the same window rather than spawning a new window.

  1. Open a new Nautilus window by double clicking on any folder on your Desktop, or by clicking through Places -> Home Folder.
  2. Select Edit -> Preferences.
  3. Under the Behavior tab, enable the Always open in browser windows checkbox.

That’s it. I blame it on a poorly labelled toggle that sounds more like Nautilus is going to open files in my web browser.

Isaac Su

tags: behavior browser gnome linux nautilus window

Comment

---

2009-12-23, Wed

User is not in the sudoers file

When attempting to perform certain operations using the sudo command on my Fedora installation, I receive the error message saying

    isaac is not in the sudoers file. This incident will be reported.

Here’s how you can fix it.

  1. Log into the root account.
    #su
  2. Once in the root account, edit the sudoers file.
    $pico /etc/sudoers
  3. Look for the line that looks something like
    root ALL=(ALL) ALL
  4. Underneath that line, add your username (in my case, isaac).
    isaac ALL=(ALL) ALL
  5. Ultimately, your sudoers file should look something like this
       root    ALL=(ALL) ALL
       isaac   ALL=(ALL) ALL

Note: The sudoers file is a security measure that prevents normal users from executing commands that may harm the system. Use this with great caution.

Isaac Su

tags: administration centos fedora linux pico redhat sudo sudoers ubuntu

Comment

---

2009-12-22, Tue

dhcpd quirks in Fedora 11 with webmin

I tried to set up a simple DHCP server on my brand new Fedora 11 installation via Webmin. I’d put in all the relevant information, but I kept getting a dhcpd start fail.

When I tried starting the dhcpd

      $ sudo /usr/sbin/dhcpd

it returned an error that looks something like:

      No subnet declaration for eth0
      ** Ignoring requests for eth0

What I found out is that webmin looks for the dhcpd.conf file in /etc/dhcpd.conf while Fedora 11 places it in /etc/dhcp/dhcpd.conf.

To fix this:

  1. In webmin, click on the Module Config link on the top left corner of the DHCP Server webmin page.
  2. In the DHCP server config file text box, change the value to /etc/dhcp/dhcpd.conf then save.
  3. Reconfigure the DHCP Server configuration.
  4. Click ‘Start Server’ when you’re done.

It should work now.

Thanks to this post

Isaac Su

tags: dhcpd dhcpd.conf fedora-11 webmin

Comment

---

2009-12-07, Mon

Use Blackberry Browser on standard GPRS TCP connection (no BES/BIS)

Blackberry makes really good devices for phone calls and SMS’s, but I haven’t found a good enough reason to shell out almost $30/month for the privilege of using their email service.

Till now, the only browser I get to use is Opera Mini, which is quite slow and heavy compared to the native blackberry browser.

Recently, I’ve found a way to reenable my blackberry browser by installing some custom services books. These service books configures the browser to use a standard TCP/GPRS connection rather than the BIS/BES connection.

This also means no more ‘Unable to open a PDP Context’ and ‘blackberry.wap’ errors.

Isaac Su

tags: apn bes bis blackberry browser gprs service-book tcp

Comment [3]

---

« Older Newer »