Monday, November 14, 2011

Change Console Fonts!

I've been tinkering around with Linux lately and was thinking about setting up a spare box... without a GUI. You know, perhaps on an older computer that would simply be a file server?

Anyway, so I've been messing around with the fonts in the console for Linux. Don't know what I'm talking about? Press <CTRL>-<ALT>-<F1>. You can also do <CTRL>-<ALT>-<F2>, and so forth, all the way to <F6>.

Notice how small the screen is? We can fix that.

First, you'll need to edit the /etc/default/grub file. See the part that says GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"? You'll want to add in there vga=xxx, where 'xxx' represents a code for a resolution. See the following two URLs for additional information about this.

http://en.wikipedia.org/wiki/VESA_BIOS_Extensions
https://wiki.ubuntu.com/FrameBuffer

Now, restart your system. See? Pretty.

Now, on to the fonts.

Edit the /etc/default/console-setup file. See the part that says FONTFACE and FONTSIZE? You'll want to change these to the values specified in the file.


After changing them, you'll execute 'setupcon' and boom. Pretty fonts! :)

Now, I haven't been able to find out how to have the consoles automatically start with your custom fonts every time the system starts. My guess would be checking the startup scripts in /etc/rcX.d. Or, perhaps there's another place to put them, like somewhere in your home directory in one of the hidden files (the ones that are preceded with a '.').

Anyway, I just thought I'd post what I have for now. Credit goes to the following website:

http://www.shallowsky.com/blog/linux/console-setup-ubuntu.html

Monday, November 7, 2011

Cisco Packet Tracer (ugly, horrid) Fonts

So, for those of you Cisco people out there, I'm sure there will be a point where you will want to install and use Packet Tracer for your network simulations. Read below if you are having issues using it.

If you don't know what I'm talking about, not to worry. This is a program designed by Cisco which let's you create network environments and simulate network traffic. It's a nifty tool.

I acquired PacketTracer53_Ubuntu.tar.gz from Cisco's Net Academy website (cisco.netacad.net) after doing a search for Packet Tracer (while logged in).

Afterwards, I unzipped it (tar -xvzf PacketTracer53_Ubuntu.tar.gz) into my Downloads directory and did a sudo ./install from the directory containing the extracted files.

Everything is fine from here... until you open the application. Then, you are presented with a GUI that has the crappiest, most horrific looking fonts you'll ever see in your life! Not to worry. This can be fixed.

The problem? Packet Tracer uses its own Qt4 libraries instead of using the ones that you already have on your system. From what I understand, any of the subpixel rendering that has been compiled into the libraries on your system are not present in the libraries for Packet Tracer. The Qt4 packet tracer libraries are located in the /opt/pt/lib directory, assuming you installed Packet Tracer in /opt/pt.

The solution? See below. THIS ASSUMES YOU ARE USING MINT LINUX 11 AND QT LIBRARIES 4.7.2. I am confident it will work on Ubuntu (and hopefully, other QT versions), but not so sure on other distributions (i.e. the directories may be different). Keep this in mind.

First, back up the lib directory where you installed Packet Tracer. This is /opt/pt/lib by default.
cd /opt/pt
sudo cp -r lib lib.bak

UPDATE: Second, you may need to install the following packages. Execute the following:

sudo apt-get install libqtwebkit2.2-cil libqt4-script libqt4-qt3support libqt4-sql

Copy the following files from /usr/lib to /opt/pt/lib, or wherever you installed Packet Tracer.

libQt3Support.so.4.7.2
libQtCore.so.4.7.2
libQtGui.so.4.7.2
libQtNetwork.so.4.7.2
libQtScript.so.4.7.2
libQtSql.so.4.7.2
libQtWebKit.so.4.7.2

So, for the first file, you'll do:
sudo cp /usr/lib/libQt3Support.so.4.7.2 /opt/pt/lib
sudo cp /usr/lib/libQtCore.so.4.7.2 /opt/pt/lib
... and so forth, for the remaining Qt files on the list above.

Then? Go ahead and delete the 4.4.3 counterparts in the /opt/pt/lib directory. For example:

sudo rm libQt3Support.so.4.4.3
sudo rm libQtCore.so.4.4.3
... and so forth.

Now? Well, Packet Tracer will be looking for the 4.4.3 files! We need to trick Packet Tracer into using the higher version Qt libraries.

The trick? Symlinks.

sudo ln -s [TARGET] [SYMLINK_FILE_NAME]

So... (do this in the /opt/pt/lib directory, or wherever the PT library directory is)

sudo ln -s libQt3Support.so.4.7.2 libQt3Support.so.4.4.3
sudo ln -s libQtCore.so.4.7.2 libQtCore.so.4.4.3
... and so forth, for all of the Qt files we copied.

As a result, when Packet Tracer tries to access the 4.4.3 libraries, they'll actually be using the 4.7.2 libraries.

Finally, you'll want to make all of the libraries we've copied over from /usr/lib executable. To do this, perform the following:

sudo chmod +x libQt3Support.so.4.7.2
sudo chmod +x libQtCore.so.4.7.2
... and so forth.

Now run Packet Tracer. You should be good to go.

You'll notice that there are two Qt files we didn't touch.

libQtAssistantClient.so.4.4.3
libQtXml.so.4.4.3

There's a reason. First, when I was doing all of this for myself, I initially didn't find the 4.7.2 counterpart for libQtAssistantClient library in the /usr/lib directory. So, I tried to perform the above steps without this file.

Second, there is a libQtXml.so.4.7.2 file in /usr/lib. However, if you use this file in /opt/pt/lib and run Packet Tracer, it will segfault when you try to do things like delete devices. I think this has to do with methods/functions in the code that can change from some versions to others, but don't quote me on that. So, as a result, I avoid using this file.

If you're a savvy user, you may see other ways to perform essentially what I have done above. No problem. I just posted what I did so you get the idea of what I accomplished.

And the result? Look... pretty!


If you want to contrast my steps with the troubleshooting steps that others have taken, see the links below:


Alright... back to basics with Nvidia and TwinView

I've been doing a ton of things with Linux today. Earlier, I recompiled the synaptics driver for my laptop since there was some jittering problems with the cursor. I'll have a separate post on that, since I went through a lengthy (though straightforward) process that I want to clearly outline for you all.

THIS post is about how to properly set up TwinView (dual displays) using Nvidia drivers.

Just in case it makes things interesting, I have my primary monitor hooked up via HDMI and the secondary monitor using DVI.

  1. First, make sure you've actually installed the latest Nvidia drivers. As of today, you'll install the nvidia-current package (via synaptic or sudo apt-get install nvidia-current in the terminal).
  2. Restart the system.
  3. Open up the Nvidia X Server Settings control panel.
  4. If not already the case, you'll need to activate both displays. When I set my monitors up for the first time, my HDMI connected LCD was not active. I had to select my monitor, click 'Configure...' and then choose TwinView. I hit apply, and boom. Two displays.
  5. I moved my secondary monitor down just a bit so my windows/cursor would move evenly across screens.
  6. At this point, customize the screens to your liking (resolution, color depth, etc.) and hit apply.
  7. Hit 'Save to X Configuration File'
  8. You should see some kind of error indicating that it can't parse the existing /etc/X11/xorg.conf. No problem. Hit OK, then there should be a 'Show Preview...' button. Select it.
  9. A bunch of text will pop up. We're only interested in one section -- "Screen".
  10. Now, open a terminal and path to /usr/share/X11/xorg.conf.d -- this is one of the directories that X examines when starting up. X essentially reads the separate .conf files that collectively configure your X environment.
  11. Type in gksudo gedit ./20-nvidia.conf and press <ENTER>
  12. Copy just the "Screen" section that the Nvidia configuration tool outputted to the gedit session you have open. Save afterwards.
  13. Log out then back in. You're all set!

Welcome!

Welcome to my blog! This is the place where I intend to document all types of random information, fixes, and musings regarding Mint Linux. Though I certainly hope the stuff I post here has application in other distros, my emphasis will be on Mint (and Ubuntu) since it's what I use the most.


Please post your thoughts, questions, and let me know if you have any questions about this awesome Linux distro. =)