Computer Scientist, Graduate Student, and Geek

Category: Linux

Diagram in Powerpoint (PPTX) to Postscript (PS)

May 06, 2013

Converting a diagram made in PowerPoint to a postscript file (so it can be included in a LaTeX document) is a complex multistep process. Below are the steps I follow:

  • Print the slide with the diagram to a PDF using CutePDF (using PowerPoint's Save As PDF option will result in a huge postscript file in the end)
  • Run the following sequence of commands, setting the NAME variable to the name of the PDF file, sans extension:
    NAME=mydiagram; pdfcrop $NAME.pdf; pdf2ps -r300 $NAME-crop.pdf; \
    mv $NAME-crop.ps $NAME.ps; rm $NAME-crop.pdf

Categories: Linux

Tags: latex, pdf, postscript, powerpoint


Merging PDFs

August 22, 2012

pdftk - The PDF Toolkit is a handy tool for merging PDFs (and many other manipulations, e.g., removing pages from a PDF). On major Linux distributions, it can be installed with yum or apt. To merge multiple PDFs into a single PDF, execute a command similar to:

pdftk inputA.pdf inputB.pdf inputC.pdf cat output output.pdf

The above command creates a new PDF called output.pdf which includes all pages from the PDFs inputA.pdf, inputB.pdf, and inputC.pdf.

Categories: Linux

Tags: pdf


Old Versions of Firefox

February 16, 2012

Fedora 13 does not have all the necessary dependencies for Firefox 10, so I needed to downgrade to Firefox 9. I finally managed to find the installers at: https://ftp.mozilla.org/pub/mozilla.org/firefox/releases

Categories: Linux

Tags: fedora, firefox


Fix X11 Forwarding over SSH in Ubuntu 10.04 (Lucid)

October 13, 2011

There is a bug in Ubuntu Lucid’s sshd (SSH server) that causes issues with IPv6-enabled network interfaces preventing X11 forwarding over SSH from working properly. The error in /var/log/auth.log is:

error: Failed to allocate internet-domain X11 display socket.

To fix the issue, you need to tell sshd to only listen to IPv4. Add the following line at the top of /etc/ssh/sshd_config (before the Port configuration):

AddressFamily inet

Solution is from: http://www.se.cuhk.edu.hk/~hmleung/wordpress/?p=876

Categories: Linux, Networking

Tags: ssh, ubuntu


Persistent Iptables in Ubuntu

September 09, 2011

Fedora defaults to persisting iptables (the Linux firewall) between restarts, but this is not the default case in Ubuntu. To have iptables persist between reboots in Ubuntu, you can install the iptables-persistent package:

sudo apt-get install iptables-persistent
The persistent tables will be stored in /etc/iptables/rules by default. You can save the live iptables to the persistent file using:
sudo iptables-save< /etc/iptables/rules

Solution is from https://help.ubuntu.com/community/IptablesHowTo#Configuration_on_startup

Categories: Linux, Networking

Tags: iptables, ubuntu


Focus Window on Mouse Over in Gnome

August 11, 2011

To have a window receive focus when you move your mouse over it in Gnome, you need to change a setting in gconf-editor. If gconf-editor is not installed, you can install it by running yum install gconf-editor as root. Run gconf-editor as the user whose mouse over behavior should be changed. Navigate to /apps/metacity/general. Change the value of the key focus_mode to mouse.

Categories: Linux

Tags: gnome


Fixing Gnome Themes in Ubuntu 11.04 (Natty)

May 17, 2011

A laptop that was dist upgraded from 10.11 to 11.04 was not applying the correct Gnome themes. Changing the theme in Appearances did not fix the issue. The solution was to uninstall the gnome-accessibility-themes package and install the gnome-themes-standard package. This can be done with the commands:

sudo apt-get purge gnome-accessibility-themes
sudo apt-get install gnome-themes-standard

This blog posted is based on a forum post at: http://ubuntuforums.org/showthread.php?t=1725221&page=2

Categories: Linux

Tags: gnome, ubuntu


Install SNMP on Ubuntu

May 06, 2011

To install SNMP on Ubuntu, run the commands below (as root):

apt-get install -y snmpd

CONFIG="/etc/snmp/snmpd.conf"
mv $CONFIG $CONFIG.bak
echo rocommunity  public > $CONFIG
echo syslocation  "put location here" >> $CONFIG
echo syscontact   youremail@yourdomain.com >> $CONFIG

CONFIG="/etc/default/snmpd"
mv $CONFIG $CONFIG.bak
cat $CONFIG.bak | grep -v SNMPDOPTS > $CONFIG
echo "SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid \
        -c /etc/snmp/snmpd.conf'" >> $CONFIG

service snmpd restart

echo "Installed snmpd"

If you have a firewall, you will also need to allow UDP traffic on port 161. If you use iptables this can be accomplished with

iptables -A INPUT -p udp -m state --state NEW -m udp --dport 161 -j ACCEPT

You can test if SNMP is working by running snmpwalk from another machine:

snmpwalk -v 1 -c public -O e hostname

This blog posted is based on documentation at http://www.it-slav.net/blogs/2009/02/05/install-and-configure-snmp-on-ubuntu.

Categories: Linux, Networking

Tags: snmp, ubuntu


Ubuntu 11.04 (Natty) Automated Network Installation

May 05, 2011

Many sources exist to help with setting up automated network installations of Ubuntu. Below are a list of sources I used to get automated network installations of Ubuntu 11.04 (Natty Narhwal) working.

Categories: Linux

Tags: pxe, ubuntu


Lenovo X201 Graphics in Fedora 13

March 29, 2011

I wanted to use the intel X11 driver with my Lenovo X201 laptop. However, X11 was failing to start, with the following error message in the log:

intel(0): No kernel modesetting driver detected
To fix the problem, I needed to edit my kernel boot options. I added the following to the kernel boot line in my grub.conf:
i915.modeset

Categories: Linux

Tags: fedora, x11


Older Entries >>