Defaulting a User Mountable (e.g USB /Thumb) Drive in CentOS With exec
Privileges
Symptoms
- Drive mounts OK when attached (e. g.: plugged into USB)
- Cannot execute programs -- even as root.
- Does not show up in
/etc/fstab
- Shows up on
/etc/mtab
withnoexec
mounting options.
Resolution
Caveat: This is a pretty broadsword approach.
- When mounted, take a look at the details in
/etc/mtab
:cat /etc/mtab
- What you are looking for is the file system type and mounting options.
- Check out the details (including the options) in the
man
page formtab
.
- In the Gnome Configuration Editor:
- Find the file system ( /system/storage/default_options/...)
- Add the following as a high-priority item to the
mount_option
entry:exec
- Thus, your entry might look like this:
[exec,shortname=foo,uid=]
0 comments
Adding Programs to the 'Open With' Diaglog in Gnome
- As superuser, edit:
/usr/share/applications/mimeinfo.cache
/etc/gnome_defaults.conf
or/etc/gnome/defaults.conf
- As normal user, edit the details in the
MimeType
section in~/.local/share/applications/[FOO-PROGRAM].desktop
0 comments
Sun Java Setup Notes on Centos x64
- Find OpenJDK related packages. Take some notes as to what
alternatives
lists; you'll be setting this up later to point correctly to Sun Javayum list installed jre
yum list installed jdk
yum list installed gcj
ll /etc/alternatives/j*
- Uninstall OpenJDK related:
yum remove jre
yum remove /* other java related packages */
- Get the JDK for x_64 from Oracle ( http://www.java.com ); install as root as directed on site.
Take note of where Java installs to; you'll need it for re-pointingalternatives
! - Delete (if necessary) and make a soft link:
ln -s [location where Java installed] /usr/java/latest
- Re-point alternatives (as root):(... and anything else that needs to be re-pointed from the list step above)
/usr/sbin/alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 1
/usr/sbin/alternatives --install /usr/bin/jarsigner jarsigner /usr/java/latest/bin/jarsigner 1
/usr/sbin/alternatives --install /etc/alternatives/java java /usr/java/latest/bin/java 1
/usr/sbin/alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 1
/usr/sbin/alternatives --install /usr/bin/javadoc javadoc /usr/java/latest/bin/javadoc 1
/usr/sbin/alternatives --install /usr/bin/javah javah /usr/java/latest/bin/javah 1
/usr/sbin/alternatives --install /usr/bin/java_sdk java_sdk /usr/java/latest 1
/usr/sbin/alternatives --install /usr/bin/jre jre /usr/java/latest/jre/ 1
- Verify your setup:
java -version
javac -version
ls /etc/alternatives/j* - Setup the browser plugin for Firefox (these directions differ from those on Oracle's site):
(as root):cd /usr/lib64/mozilla/plugins
ln -s /usr/java/latest/jre/lib/amd64/libnpjp2.so . - If necessary, you may also need to setup the link to the Java plugin as the user:
(not super-user):cd ~/.mozilla/plugins
ln -s /usr/java/latest/jre/lib/amd64/libnpjp2.so .
- Site where found: http://labs.adobe.com/downloads/flashplayer10_square.html
- File desired:
flashplayer10_2_p3_64bit_linux_111710.tar.gz
Make sure you get the 64 bit version! The typical download location on Adobe's site doesn't list the 64 bit version! - As root, unpack the tarball into the mozilla plugin directory (where you created the link for the Java plugin above) and make it executable:
tar -zxvf flashplayer10_2_p3_64bit_linux_111710.tar.gz -C /usr/lib64/mozilla/plugins
chmod +x /usr/lib64/mozilla/plugins/libflashplayer.so
0 comments
Ho's on my Dong
Great Firewall?
0 comments
Java Disabled in Firefox; Only For a Specific User; Works in Other Browsers
WTF?
After fiddle-farting around with deleting caches, preferences and other nonsense, I re-downloaded Firefox and re-installed overtop the existing app in Applications. Oddly, that did the trick.
Weird...
0 comments
bash
Command for ImageMagick Mass Conversion
for file in `ls -1 [source-dir]`; do convert [source-dir]/$file -monitor -resize 784 +repage [destination-dir]/$file; done
Example out:
$> for file in `ls -1 raw/ssh-keygen`; do convert raw/ssh-keygen/$file -monitor -resize 784 +repage 784wide/ssh-keygen/$file; done
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-01-windows-command-prompt-01.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-02-windows-command-prompt-02.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-03-windows-command-prompt-03.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-04-windows-command-prompt-04.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-05-mac-admin-access-01.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-06-mac-terminal-02.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-07-mac-terminal-03.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-08-mac-terminal-04.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-09-linux-terminal-01.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-10-linux-terminal-02.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-11-linux-terminal-03.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-12-linux-terminal-04.png]
0 comments
Gnome Cosmos Background (The Space /Astronomy Changing Pictures Background)
With thanks to this guy, I finally found how to create and manage my own Gnome changing wallpaper. I like downloading pictures from Astronomy Picture of the Day, and I've wanted to add them to Gnome's space themed changing wallpaper. Gnome's wallpaper XML file isn't as slick as dumping pictures in a designated folder (although I'm sure there is something out there that does that), but it works well enough.
XML File Format
<background>
<starttime>
<year>2009</year>
<month>08</month>
<day>04</day>
<hour>00</hour>
<minute>00</minute>
<second>00</second>
</starttime>
<static>
<duration>time in milliseconds to display image</duration>
<file>/absolute/path/to/image/file</file>
</static>
<transition>
<duration>time in ms to transition image</duration>
<from>/absolute/path/to/current/image/file</from>
<to>/absolute/path/to/next/image/file</to>
</transition>
</background>
Usage
Simply place the XML file in a location where you can edit and find it quickly. Personally, I saved the pictures (and XML file) in ~/backgrounds
0 comments
When You Can't Even fsck
, How to Reinstall grub
So you've bricked your machine. You can't even use
fsck
(note: the command has one letter difference from the word said immediately prior to running it), because you just get that flashing underscore looking thing on a black screen.Us old timers call that a cursor. When that's all you see when you boot your computer, it's not the only thing that is cursing.
Here's what you do.
RULE 1 WITH ANY LINUX DISTRO: ALWAYS HAVE A BOOT DISK.
I'm not kidding. You are up the proverbial defecation creek without a shovel and only your tongue to guide you if you don't have a boot disk. In days of old, we carried around floppies for such things. These days, you need only a live CD (preferably installed to a flash drive).
If you don't have a Live CD, you have officially learned your first Linux lesson. Go download one for your distribution right now and get it burned (or as stated before, preferably installed to a USB drive).
- Boot to your Live CD/USB drive.
- Open a terminal.
- List out your partitions
- Reconfigure grub to to to the partition with
/boot
. - Reboot
To find your partitions, enter the following into the terminal:
df
You should see something like this:
/dev/sda2 305592212 256413288 33655720 89% /
/dev/sdb1 480719056 202796 456097060 1% /data
In the example listed above, my swap partition is
/dev/sda1
, and my root ( /
) partition is /dev/sda2
(yours will probably be different). I don't have /boot
on a different partition, so /dev/sda2
is what I am looking for. Here's what you want to note:
- sda2 is the second partition on my first hard drive.
- sdb1 is the first partition on my second hard drive.
- grub is zero-based, so if I'll need to subtract 1 from both the number of hard drive and the partition to get it configured correctly (see below)
To reconfigure grub, at terminal enter the following:
grub
root (hd0,1)
setup (hd0)
quit
Ok... so where did the numbers come from?
First I entered
root (0,1)
. This told grub that the root partition was on the first hard drive, second partition. Remember I said subtract 1? - The root partition was
sda2
. - "a" is the first letter in the English alphabet; subtract 1 and you have 0.
- "2" indicates the second partition; subtract 1 and you have 1.
Thus,
root (hd0,1)
Next I told grub to setup the root partition for booting. If you understood what I explained just previously, then this should make sense:
setup (hd0)
The final thing you need to do is reboot -- making sure you pull out your live CD/USB at the right time to you don't boot to it.
Credits
First and foremost, my older brother TK. He taught me rule #1.
Second, my co-worker and colleague, Mr. MB. He sent me a chat the last time I fubar-ed up grub, and it made me remember what to Google for. I owe you (yet another..) beer sir!
Finally, "remmelt" on the Ubuntu forums (although it worked for my OpenSuSe install too): http://ubuntuforums.org/archive/index.php/t-24113.html
Labels: grub, linux, SuSe, Ubuntu
0 comments
Make Win7 Explorer Open at Root ( \ )
- R-Click Win Explorer > Properties
- Win Explorer Properties Box: Shortcut tab.
- Change Target box to read:
%SystemRoot%\explorer.exe /e,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
0 comments