Archive

Archive for the ‘linux’ Category

Latexila: Latexmk -synctex=1 bad option

October 30th, 2013 3 comments

Hey there!
Some of you maybe also use Latexila to create their Latex documents. In the current version the predefined build commands fail with an error message

Latexmk: -synctex=1 bad option
...

I’m not sure if this is a mistake in the defined commands in Latexila or the options of Latexmk have changed. But anyway, the proper way to work around is to remove the synctex argument from the build commands within the GUI. Unfortunately, on my system (Debian Jessie – Latexila 2.8.3) the frontend immediately forgets about the changes.

Fortunately, we run an open system so one can modify the XML file which defines these commands. It’s location is:

/usr/share/latexila/build_tools.xml

We will see if this survives the next system update, cheers! 😉

Categories: linux, software Tags: , , ,

Medibuntu is Terminated

October 16th, 2013 No comments
Categories: linux Tags: , , ,

Number Replacement in Filenames

October 15th, 2013 1 comment

Just assume you have a lot of files with numbers in their names, but these numbers do not have leading zeros. How would you fix that?

rename 's/\d+/sprintf("%04d",$&)/e' *.FILEENDING

This command leaves the characters in the file name and replaces all numbers with the same number and leading zeros. Works with bash and ZSH, no warranty 😉 You also can replace the “04d” with “0Xd” and you get X digit numbers.

cannot connect to X server after su

May 2nd, 2013 No comments

When you connect via SSH with X11Forwarding enabled to a remote host, switch the user via su, and try to run a X-application, you will usually end up with the following error message.

X11 connection rejected because of wrong authentication.
APPLICATIONNAME: cannot connect to X server localhost:11.0

This is the case because only the user who connected to the host has the access rights to connect to the his X-session. I found a post mentioning the little tool sux (for su and X) which wraps the wanted functionality. It is available for Debian/Ubuntu via apt. If you want to have X but have to switch user just do

sux USER

that’s all. THX.

Categories: linux Tags: , , ,

libmysql-dev missing on a webhoster when trying to install mysql-python

March 21st, 2013 1 comment

can be a pain in the arse . . .
As I had to do this a couple of times lately, here is a annotated snippet of my bash history. This is mainly a “note to self”:

#install virtenv
curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.9.1.tar.gz
tar xvfz virtualenv-1.9.1.tar.gz
mkdir src app bak
mv virtualenv-1.9.1.tar.gz bak/
mv virtualenv-1.9.1 src/
python src/virtualenv-1.9.1/virtualenv.py app/
. ./app/bin/activate
# try to install - it will fail with missing libmysqlclient headers and stuff
pip install mysql-python
uname -a
cd src/
# get the package we cannot install (no root/sudo) 
wget http://security.debian.org/debian-security/pool/updates/main/m/mysql-5.1/libmysqlclient-dev_5.1.66-0+squeeze1_amd64.deb
ar x libmysqlclient-dev_5.1.66-0+squeeze1_amd64.deb
mkdir libmysqlclient-dev
mv control.tar.gz libmysqlclient-dev/
mv data.tar.gz libmysqlclient-dev/
mv libmysqlclient-dev_5.1.66-0+squeeze1_amd64.deb libmysqlclient-dev/
cd libmysqlclient-dev/
tar -xzf data.tar.gz
cd usr/
cd bin/
cp mysql_config /home/william/app/bin/
cd ..
cd include/
cp -a mysql /home/william/app/include/
cd ..
cd lib/
cp -a * /home/william/app/lib/
cd ..
cp -a share /home/william/app/
cd ~
vim .bashrc
#[logout and in to activate bashrc changes]
. ./app/bin/activate
#try again - it will report the missing libs that cat be found in /usr/lib
pip install mysql-python
cd app/lib/mysql/
cp /usr/lib/libmysqlclient* ./
cd ~
# try a third and hopefully last time
pip install mysql-python

Willi

Categories: linux Tags:

ssh keys and encrypted home directory

March 21st, 2013 4 comments

If home is encrypted, sshd cannot access your authorized_keys file. Therefore key based auth only works after loging in via passwort to unlock home. Solution is to change the location where sshd looks for the keys to a folder outside encrypted home:

mkdir /etc/ssh/william
chown william:william /etc/ssh/william
mv /home/william/.ssh/authorized_keys /etc/ssh/william/
vim /etc/ssh/sshd_config 
AuthorizedKeysFile /etc/ssh/%u/authorized_keys
service ssh restart

This solution is also described here: https://help.ubuntu.com/community/SSH/OpenSSH/Keys#Troubleshooting

Cheers,
Willi

Categories: linux, software Tags:

Could not read DVD. This may be because the DVD is encrypted and a DVD decryption library is not installed.

February 6th, 2013 2 comments

This thing above is the actual error message I got when I was trying to play a DVD that I legally bought…well f*** you guys I thought and after emptying my bottle Jim to the half and stressing Google I found a solution.

libdvdcss seems not to be included in Debian packages anymore…don’t know why. 😉 But this URL will contain DEB-files one can install via dpkg -i to view the content one’s payed for.

http://packages.medibuntu.org/pool/free/libd/libdvdcss/

Have fun 😉

Categories: linux Tags:

Recovering microSD under Ubuntu (12.04), should work on other Linuxes

January 28th, 2013 5 comments

My Android phone somehow managed to kill the inserted 32 GB microSD card, which is really annoying as I have most of my applications on this card and – which is much worse – photos taken at several occasions.

When I connected the card (via an SD-microSD adapter), Ubuntu told me “mount: /dev/sdb1: can’t read superblock” (obviously trying to mount it as ext).  Forcing Linux to mount the card as FAT didn’t work either, so I googled somewhat and found a tool called TestDisk!

TestDisk allows to recover lost data and this is what I did to get most of my content back

  1. sudo apt-get install testdisk
  2. sudo testdisk
  3. [Create] create a new log file
  4. Select /dev/sdb (“…FlashMedia”) and Proceed
  5. Select [Intel] Intel/PC partition
  6. (Backup, just in case sth happens)  [Advanced] -> [Image Creation] -> Select target Folder
  7. [Analyze]->[Quick Search]
  8. [Enter to continue]
  9. [Deeper Search]
  10. [P] (list files)
  11. [A] (select all files, which includes folders)
  12. [C] Copy files
  13. select target folder
  14. [C] (copy to selected folder)

And thats it 🙂 Whee!!!!

Categories: linux Tags: , , , ,

Best error message [ever]

December 11th, 2012 1 comment

Sometimes a weeklong debug session can be very very VERY frustrating, especially if you have to debug openmpi (and i mean the lib, not mpi programs).

But a nice error message like this one

Suddenly the Dungeon collapses!! – You die…

of a remotely killed screen session can put a smile in your face and gives you new hope!

Categories: linux, nerdcore Tags: ,

sudo forgot /sbin

December 10th, 2012 No comments

I got confused by some APT messages today, saying it cannot find ldconfig. A little trial-and-error made me found my environment (PATH) has forgotten /sbin and other folks. Long story short, it turns out sudo did not source the environment correctly, leaving out root-depending paths. Adding the following line at the top of  /etc/sudoers will fix this:

Defaults        secure_path=”/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin”

So long…

Categories: linux Tags: