2013-01-26

linux mint, mate, panels: change desktop folder location

if you don't want mate to use the $HOME/Desktop folder as the folder it actually shows on your desktop, you can change which location it uses.

i couldn't find anything by searching for this until i remembered that mate is a successor of gnome2.  so, i looked up how to do it for gnome2 and it seems to be kind of the same:

here's how to do it with gnome:
http://www.howtogeek.com/howto/17752/use-any-folder-for-your-ubuntu-desktop-even-a-dropbox-folder/

so, just go to your home folder, click "view"->"show hidden files", then click on the ".config" folder and then open "user-dirs.dirs" and change everything there.

alternatively (thanks anonymous),
  1. gedit ~/.config/user-dirs.dirs
  2. change the value of XDG_DESKTOP_DIR="/insert/path/here" and save it
  3. killall nautilus

2013-01-23

solution: ubuntu/mint linux doesn't shut down, cpu stuck

i have linux mint installed on my dell studio 1569 laptop.  linux mint would never shut down on its own.  i go to shut off and it just pukes all over the screen.

Linux Mint 13 Maya ajtNbMint tty1
ajtNbMint login: modem manager[2701]: <info> Caught signal 15, shutting down...

rpcbind: rpcbind terminating on signal.  Restart with "rpcbind -w"
nm-dispatcher.action: Caught signal 15, shutting down...
[  766.704047] BUG: soft lockup - CPU#3 stuck for 23s! [reboot:9642]
[  766.704341] Stack:
[  766.704304] Call Trace:
[  766.704410]  <IRQ>
[  766.704404]  <EOI>
...

----------
important edit 2014-06-09:

if you are running ubuntu 12.04, i recommend updating to ubuntu 14.04.  this has fixed many hardware related issues for me.

-----------
important edit 2013-11-11:

i don't think the below solution actually does anything, despite people say it working.  this is because the bug only happens when you shut down the computer after it has been on for a while, but when you test a new boot parameter, you restart so it can take effect and then shut down immediately after restarting to test it.  because you shut down right after starting up, it seems to have worked, and then post "thank you" and realize later that day that it didn't work.

this bug has already been reported to linux and is already fixed in the "mainline kernel" which means that it just hasn't been rolled out to normal users yet because it's not completely tested.  here is the bug report where the reporter says the bug has been fixed upstream:  https://bugs.launchpad.net/ubuntu/+source/linux/+bug/254326

no need to wait -- you can begin using the mainline kernel now.  all i did was install an image*.deb file and now when i boot up, i can choose "ubuntu with advanced options" and boot using the updated kernel.
https://wiki.ubuntu.com/Kernel/MainlineBuilds?action=show&redirect=KernelMainlineBuilds

after using the new kernel, my computer turns off normally even after several hours of use, and it also doesn't crash every 2 hours or after resuming from sleep anymore.

below are the old suggestions, which i believe DO NOT work!
let me know what actually works for you in the comments.  remember, to test if your change worked, you should use your computer for a couple hours before shutting down.

-----------


for some people, adding the kernel boot parameters "noapic" fixes the problem:
  • http://muffinresearch.co.uk/archives/2008/08/20/ubuntu-bug-soft-lockup-cpu0-stuck-for-11s/
  • https://bugs.launchpad.net/ubuntu/+source/linux/+bug/206316

once i did this, my computer still didn't shut down, but it gave me this helpful message:  "irq 19: nobody cared (try booting with the "irqpoll" option)".  so i also added the "irqpoll" kernel boot parameter, and ever since it has shut down beautifully.  this has to do with intel and linux not playing well together.

if you are using grub2, simply run 
gksudo gedit /etc/default/grub


and add "noapic" to the line starting with "GRUB_CMDLINE_LINUX_DEFAULT":

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash blah blah blah noapic irqpoll"

2012-11-28

solution to vagrant up -> "The host class is reporting that NFS is not supported by this host"

got this error running vagrant up:
ajt@ajtNbMint /media/c/ajt/edu/20122/eng100l/github/whwn $ vagrant up
[default] VM already created. Booting if it's not already running...
The host class is reporting that NFS is not supported by this host,
or `nfsd` may not be installed. Please verify that `nfsd` is installed
on your machine, and retry.

in linux, i solved this by opening synaptic package manager and installing "nfs-kernel-server"

too late for me to try now, but i have a feeling that running this in a terminal would work too:
sudo apt-get install nfs-kernel-server

in windows, change the vagrantfile so you use virtualbox's shared folders instead of nfs, by setting nfs=>false:
config.vm.share_folder "blah", "~/blah", ".", :extra => 'dmode=755,fmode=644', :nfs => false

2012-11-15

split "city, state zip" in excel.


here are some formulas to split a cell containing city, state and zip into separate city, state and zip cells in microsoft excel.

format: "city, state zip" e.g. "La Jolla, CA 92092-0100"
  • comma after city name, followed by a space
  • state is two letters, followed by a space
in cell b1, type
=LEFT(A1,(FIND(",",A1))-1)

in cell c1, type
=MID(A1,FIND(",",A1)+2,2)

in cell d1, type
=RIGHT(A1,LEN(A1)-FIND(",",A1)-4)

format: "city, state zip" e.g. "La Jolla, California 92092-0100"
  • comma after city name, followed by space
  • state is specified but of any length and followed by space
in cell b1, type
=LEFT(A1,(FIND(",",A1))-1)

in cell c1, type
=MID(A1,FIND(",",A1)+2,FIND("*", SUBSTITUTE(A1, " ", "*", LEN(A1) - LEN(SUBSTITUTE(A1, " ", ""))))-(FIND(",",A1)+2))

in cell d1, type
=RIGHT(A1, LEN(A1) - FIND("*", SUBSTITUTE(A1, " ", "*", LEN(A1) - LEN(SUBSTITUTE(A1, " ", "")))))

format: "city state zip" e.g. "La Jolla CA 92092-0100"
  • city, state, zip separated by 1 space only
  • state is two letters
in cell b1, type
=LEFT(A1,(FIND("*", SUBSTITUTE(A1, " ", "*", LEN(A1) - LEN(SUBSTITUTE(A1, " ", "")))))-4)

in cell c1, type
=MID(A1,(FIND("*", SUBSTITUTE(A1, " ", "*", LEN(A1) - LEN(SUBSTITUTE(A1, " ", "")))))-2,2)

in cell d1, type
=RIGHT(A1, LEN(A1) - FIND("*", SUBSTITUTE(A1, " ", "*", LEN(A1) - LEN(SUBSTITUTE(A1, " ", "")))))

2012-10-26

run linux mate in sudo mode

i have linux mint with the mate desktop, and i wanted to copy a file into a folder but got "error opening file: permission denied" or "the folder cannot be copied because you do not have permissions to create it in the destination".  i remembered before that i could run mate as root or in sudo mode or something, but i couldn't remember what it was called.  so how do you do administrative tasks in mate?

when you browse the contents of a folder in mate, you are actually seeing the caja app built into mate.  so i will tell you how to run caja as an administrator or "as superuser".

open a terminal, and type "sudo caja".  boom! done.  you can do anything in this window.

if you want to run all of mate apps in administrative mode, you can type "sudo mate-panel".  i'm not sure how you're going to close your first instance of mate-panel so you might be stuck with 2 task bars on top of each other.

2012-10-13

change date and time format of clock applet in linux mint mate

in the mate desktop environment that comes with linux mint, the clock is an applet built into the panel program.

to change the date and time format, press alt+f2 or open a terminal window.  type "mateconf-editor" and press enter.  this opens the configuration editor for mate.  if you don't have this installed, type "apt-get install mate-conf-editor" in a terminal.

navigate to /apps/panel/applets/applet_clock and click on "format".  read the long description and possibly set the value to "custom".  if you use "custom", also change the "custom_format" field, which accepts the same format strings that strftime() uses.

i set custom_format to "%F %H:%M" which displays the time in the format 2012-10-13 15:17

2012-10-06

solution to ImportError: No module named OSRNG

i was trying to run fab bootstrap on my windows machine an received the error: "ImportError: No module named OSRNG"

i found a folder on my computer called C:\PythonX\ that had the package i needed.  i merged the contents of this folder with my python installation in "C:\Program Files (x86)\python27\"

in the end, you need to have a folder like this, but with the location to your python installation:
C:\Program Files (x86)\python27\Lib\site-packages\Crypto\Random\OSRNG