Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Friday, October 18, 2013

Ubuntu 13.10 PHPMyAdmin - mcrypt extension is missing

I am setting up a new Drupal installation with LAMP on Ubuntu (Saucy Salamander - 13.10). Installing the LAMP server and PHPMyAdmin was like a breeze. I just needed the following command:
sudo apt-get install lamp-server^ phpmyadmin
Once I logged into the fresh PHPMyAdmin interface, I realized that "mcrypt" module is missing in default Ubuntu installation. The error I found at the bottom of the PHPMyAdmin page simply page said:

"The mcrypt extension is missing. Please check your PHP configuration."

After doing a quick "apt-cache search", I found the right php5-mcrypt module that I was missing. So I issued:
sudo apt-get install php5-mcrypt
sudo service apache2 restart
Interestingly, even after this I had the "mcrypt missing" error. So I took a quick look inside my /etc/php5/ directory and found the "mcrypt.ini" inside /etc/php5/conf.d. Now for apache2 PHP5 module, the configuration files are located inside /etc/php5/apache2/conf.d (not in /etc/php5/conf.d). So I realized that although mcrypt was installed for PHP5, it was not being loaded fro Apache.

So the fix was as shown below. Basically I am just creating a symlink for mcrypt.ini inside PHP5's Apache configuration directory.
cd /etc/php5/apache2/conf.d
sudo ln -s ../../conf.d/mcrypt.ini 30-mcrypt.ini
sudo service apache2 restart
 Hope you find it useful too!

Thursday, June 7, 2012

Ubuntu 12.04 – How to use VNC even at the login prompt


I have a partially headless desktop machine on my desk only connected with a monitor. I typically use this machine for heavy duty computation or simulation. The machine is more than decent hardware wise. But I have a decent enough laptop where I like to keep all my day to day stuffs. Given the scenario, if I should ever have to use keyboard and mouse on the desktop machine, I would typically use Synergy to control the desktop using the keyboard and mouse from my laptop. Since the desktop has a much larger screen, it is quite convenient that way for many specific things. The desktop runs a SSH server. So, I can login over SSH and start the Synergy client which would connect back to the Synergy server running on my laptop. The setup is actually quite handy.

Now, there’s a catch. The problem is that synergy refuses to bind to the keyboard and mouse on the desktop machine due to missing X authentication credentials at the login prompt. Since at the login prompt, the user (me@desktop) hasn’t logged in yet. So, he (me@desktop) doesn’t have a proper X credential yet. Apparently, there is no easy way to pass the custom MIT-MAGIC-COOKIE to synergy. Therefore, I decided to fall back to VNC, which is also occasionally useful when I am working remotely.

Ubuntu 12.04 Precise Pangolin (I think 11.10 too) comes with LightDM as the login and display manager. Therefore, the desktop environments such as GNOME, KDE or LXDE would be started by LightDM only after the login has been successful. As mentioned before, Synergy can’t work in this phase because the X server authentication credentials from LightDM can not be passed easily. Therefore, to type in the password at LightDM login prompt, I use x11vnc. On Ubuntu, a quick “apt-get install x11vnc” will install it. The reason I like it a lot is mostly because it can be used like a regular console utility to start-up the VNC service. For example, I could just do “x11vnc –display :0” to quickly setup a VNC session over SSH and then login remotely over VNC. The additional benefit would be that VNC will be passed thru SSH (by means of SSH port forwarding), it will be way more secure than just plain VNC. So, coming back to where we were - to start x11vnc at the login prompt, a typical “x11vnc –display :0” wouldn’t work. Because the X server will refuse authentication as we need the authentication credentials for the LightDM service which is started as “root”. x11vnc provides an “-auth auto” option. But, it will also mostly likely fail because the “.Xauthority” file wouldn’t be found.

To get around this, we need to locate the right “.Xauthority” file where the MIT-MAGIC-COOKIE is saved. After some snooping around on my file-system, it appears that the LightDM service stores it’s files in “/var/lib/lightdm” directory. Great! now if we just do a “sudo x11vnc –display :0 –auth /var/lib/lightdm/.Xauthority” x11vnc will run in the login prompt and we will be able to use VNC even after login .

So, to recap, the steps are:

  • apt-get install x11vnc openssh-server
  • Reboot the machine (or log-out). In my case it’s my desktop.
  • ssh user@desktop. I would do it from my laptop.
  • sudo x11vnc –display :0 –auth /var/lib/lightdm/.Xauthority
  • Now, from my laptop I can use any VNC viewer to connect my desktop even in the login prompt.


Friday, January 20, 2012

GTK Theme is not being followed by all GTK Applications (on LXDE)

On my LXDE (Ubuntu Oneiric 11.10) setup, I have recently discovered that not all GTK applications are getting themed with the GTK theme (Adwaita) of my preference. 

My first obvious attempt was to reset theme with LXDE Menu > Preferences > Customize Look and Feel. I set Adwaita in the "Gadget" tab. That Didn't help. Many "sudo" applications along with some other normal GTK-3.0 applications (e.g. evince) stills stayed un-themed.


Ubuntu repository apparently has two tools to set GTK-2.0 themes:
  1. gtk-chtheme
  2. gtk-theme-switch
Gtk-chtheme is much better in my opinion. So, I gave it a shot and selected "Adwaita" from the list of installed GTK theme. Still no change.

Then as a last resort, I wanted check which GTK theme files are actually being accessed during the initialization of the applications. For that, I started Evince from the console with strace as below:
strace -e trace=access evince 2>&1 | less
After a quick checking through the output it was obvious that my GTK-3.0 themes are not being found by the applications and the theme files are being searched for both in:
  1. /home/USER-NAME/gtk-3.0
  2. /home/USER-NAME/.config/gtk-3.0
On Ubuntu, GTK themes are installed in /usr/share/themes. So, the quick, easy and clean solution to the problem was to create a sym-link to the GTK-3.0 theme of my preference as shown below:

ln -s /usr/share/themes/THEME-NAME/gtk-3.0 /home/USER-NAME/gtk-3.0
ln -s /usr/share/themes/THEME-NAME/gtk-3.0 /home/USER-NAME/.config/gtk-3.0

After creating the sym-links, I restarted Evince and voila! it's perfectly themed with Adwaita now.


P.S.
If you ware selecting another themes other than Adwaita, make sure /usr/share/themes/THEME-NAME/gtk-3.0 actually exists. Not all themes in /usr/share/themes/ are GTK-3.0 compatible and they will miss the gtk-3.0 directory inside the theme folder.

Friday, October 21, 2011

Google Chrome (Chromium) font anti-aliasing is wrong on LXDE (L)Ubuntu Oneiric (11.10)

The solution was to add the following in the ~/.fonts.conf 

xml version="1.0"?>DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
 <match target="font">
  <edit mode="assign" name="rgba">
   <const>noneconst>
  edit>
 match>
 <match target="font">
  <edit mode="assign" name="hinting">
   <bool>truebool>
  edit>
 match>
 <match target="font">
  <edit mode="assign" name="hintstyle">
   <const>hintslightconst>
  edit>
 match>
 <match target="font">
  <edit mode="assign" name="antialias">
   <bool>truebool>
  edit>
 match>
 <match target="font">
   <edit mode="assign" name="lcdfilter">
    <const>lcddefaultconst>
   <edit>
 <match>
</fontconfig>

One may have to play around with the "hintstyle" to get it right. The available options are:
  • hintslight
  • hintmedium
  • hintfull
  • none

Wednesday, October 19, 2011

Ubuntu Oneiric (11.10) DPKG error removing old Linux kernel

I stumbled into another trouble removing my obsolete packages after upgrading into Ubuntu Oneiric 11.10 with Linux kernel 3.00-12. The problem is with removing the old 64bit kernel 2.6.35-24. The Debian package name is 2.6.35-24. The error I got is following:
[13:41:34] user@machin:[/var/lib/dpkg/info]$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following packages will be REMOVED:
  linux-image-2.6.35-24-generic
0 upgraded, 0 newly installed, 1 to remove and 31 not upgraded.
1 not fully installed or removed.
After this operation, 139 MB disk space will be freed.
Do you want to continue [Y/n]?
(Reading database ... 248250 files and directories currently installed.)
Removing linux-image-2.6.35-24-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 2.6.35-24-generic /boot/vmlinuz-2.6.35-24-generic
update-initramfs: Deleting /boot/initrd.img-2.6.35-24-generic
run-parts: executing /etc/kernel/postrm.d/zz-extlinux 2.6.35-24-generic /boot/vmlinuz-2.6.35-24-generic
P: Checking for EXTLINUX directory... found.
P: Writing config for /boot/vmlinuz-3.0.0-12-generic...
E: /usr/share/syslinux/debian/extlinux: No such file or directory
run-parts: /etc/kernel/postrm.d/zz-extlinux exited with return code 1
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-2.6.35-24-generic.postrm line 328.
dpkg: error processing linux-image-2.6.35-24-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-2.6.35-24-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
The highlighted lines told me the error is caused by the postrm script called zz-extlinux located in /etc/kernel/postrm.d/. I don't know how I managed to have extlinux installed on my system. If I am not mistaken booting is still managed by grub-2. So, I decided to remove both extlinux and linux-image-2.6.35-24-generic. But, since my DPKG is already going crazy removing linux-image-2.6.35-24-generic and failing on zz-extlinux, I have to remove the old Linux image first. I quickly patched the zz-extlinux script with an "exit 0" at top followed by an "sudo apt-get -f install". One could also make it non-executable as following as a solution, followe:
sudo chmod -x /etc/kernel/postrm.d/zz-extlinux; sudo apt-get -f install
This solved my problem removing the Linux image. Now, I guess one can also remove extlinux considering Grub-2 is the bootloader.
sudo apt-get remove --purge extlinux

Tuesday, October 18, 2011

Changing Gnome-Screensaver Background on Lubuntu 11.10 (Oneiric)

I had to find a way on Lubuntu flavoured LXDE to lock/unlock the current running desktop session. The obvious easy way is to use xscreensaver and/or gnome-screensaver and do one of the following:
xscreensaver-command -lock
gnome-screensaver-command --lock
I chose to keep with gnome-screensaver since it is prettier. But immediate annoyance was after locking screen, gnome-screensaver would not retain the same background as current Lubuntu session. After trying so many options (gconf, editing files in /etc), finally I figured - the solution is rather easy.

It appears Lubutu session keeps a separate sets of options from LXDE. When gnome-screensaver is launched, it takes the background option of LXDE (not Lubuntu). To match same background both on LXDE and Lubuntu, which also matches gnome-screensaver background inside Lubuntu session, the steps are below:
  1. Set preferred desktop background on running Lubuntu session by right-click > Desktop Preferences > Background.
  2. Log-out from Lubuntu session.
  3. On the log-in prompt, select LXDE as desktop session to log into.
  4. Once inside LXDE, you'll see the desktop background that gnome-screensaver uses as background.
  5. From the right-click menu, change the background to match your preference.
That's all !!! Now, you can log in back into Lubuntu and lock screen by initiating gnome-screensaver (I use a Compiz command shortcut with Ctrl+Alt+L which triggers "gnome-screensaver-command --lock") and desktop background will match.

Ubuntu Oneiric 11.10 - problem with package dictionaries-common

I started getting troubles with dictionaries-common package right from the beginning of upgrading into Ubuntu Oneiric (11.10). The error message looks kind of like the following:


Setting up dictionaries-common (1.11.5ubuntu1) ...
update-default-wordlist: Question empty but elements installed for class "wordlist"
  dictionaries-common/default-wordlist: return code: "0", value: ""
  Choices: , Manual symlink setting
  shared/packages-wordlist: return code: "10" owners/error: "shared/packages-wordlist doesn't exist"
  Installed elements: american (American English)
  Please see "/usr/share/doc/dictionaries-common/README.problems", section
  "Debconf database corruption" for recovery info.
update-default-wordlist: Selected wordlist "" 
does not correspond to any installed package in the system
and no alternative wordlist could be selected.
dpkg: error processing dictionaries-common (--configure):
 subprocess installed post-installation script returned error exit status 255
dpkg: dependency problems prevent configuration of xscreensaver-data-extra:
 xscreensaver-data-extra depends on dictionaries-common; however:
  Package dictionaries-common is not configured yet.
dpkg: error processing xscreensaver-data-extra (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
 dictionaries-common
 xscreensaver-data-extra
E: Sub-process /usr/bin/dpkg returned an error code (1)

May be I was too quick to have skimmed over the error message and did not realize what is missing. It looks like the problem actually is that I do not have any word-list installed (or, somehow uninstalled during the distribution upgrade process) on my machine for the dictionary to point to. The quick solution is to install the preferred word-list as following:
sudo apt-get install wamerican-insane
 This should remove fix the package installation error with dictionaries-common package.


Compiz Config Settings Manager (CCSM) crashes with SIGSEGV on (L)ubuntu Oneiric (11.10)

On my latest Lubuntu 11.10 installation, CCSM stumbles into a segmentation violation (SIGSEGV) if "Desktop Cube" is enabled in Compiz plugins and I try to disable it through CCSM. Since, I managed to convince myself that "Expo" is capable of providing what I really need, I needed a way to disable it without using CCSM. So, for my own future reference and someone who's going through the same kind of nagging crash, the Compiz config file is located here:
/home/$USER/.config/compiz-1/compizconfig/Default.ini
My list of enabled plugins are below:
 [core] 
s0_active_plugins = core;detection;gtkloader;composite;opengl;copytex;decor;mousepoll;commands;imgjpeg;regex;addhelper;annotate;resize;grid;compiztoolbox;place;imgsvg;imgpng;notification;dbus;gnomecompat;resizeinfo;opacify;wobbly;move;text;loginout;scale;animation;kdecompat;thumbnail;workarounds;scaleaddon;scalefilter;animationaddon;expo;ezoom;switcher;
All one has to do is remove "cube" (or whichever is causing trouble) from "s0_active_plugins".

LightDM Fails to Load with (L)ubuntu Oneiric (11.10)

After my migration from default Ubuntu with Unity and Gnome3 to Lubuntu with LXDE and OpenBox, I realized I have managed to sacrifice beautiful LightDM, the new default login manager on 11.10 and instead, running not so pretty LXDM.

After realizing that LightDM is missing the first thing to do was obviously:
sudo apt-get install lightdm
Followed by:
sudo dpkg-reconfigure lightdm
sudo service lxde stop
sudo service lightdm start
Not much to my surprise on 11.10, LightDM didn't start. After a little digging through the log files located at /var/log/lightdm, I came across the following:

"lightdm can not write to /var/lib/lightdm/.Xauthority"

Time to check /var/lib/lightdm directory:

[11:13:26] user@machine:[/var/lib/lightdm]$ sudo ls -alh
total 44K
drwxr-x---  9  109  130 4.0K 2011-10-14 20:08 .
drwxr-xr-x 74 root root 4.0K 2011-10-17 16:56 ..
drwx------  4  119  136 4.0K 2011-10-14 15:28 .cache
drwx------  4  119  136 4.0K 2011-10-14 15:28 .config
drwx------  3  119  136 4.0K 2011-10-14 15:28 .dbus
-rw-------  1  119  136   16 2011-10-14 15:32 .esd_auth
drwx------  2  119  136 4.0K 2011-10-14 18:29 .gconf
-rw-------  1  119  136    0 2011-10-14 19:55 .goutputstream-54JJ3V
drwx------  2  119  136 4.0K 2011-10-14 15:28 .gvfs
drwxrwxr-x  3  119  136 4.0K 2011-10-14 15:32 .local
drwx------  2  119  136 4.0K 2011-10-14 16:22 .pulse
-rw-------  1  119  136  256 2011-10-14 15:32 .pulse-cookie
-rw-------  1  119  136    0 2011-10-14 20:08 .Xauthority


After checking /etc/passwd and /etc/group, it confirmed that somehow user-id 119 and groupd-id 136 has gone missing from my system. So, as a quick roll-back, I did the following:

sudo apt-get remove --purge lightdm
sudo mv /var/lib/lightdm /var/lib/lightdm.bak
sudo apt-get install lightdm
sudo service lxdm stop
sudo apt-get remove --purge lxdm
sudo service lightdm start

Voila, LightDM showed up with a nice log-in prompt. Re-installing LightDM, added a new user and group with ids 109 and 130 respectively. Also, the ls output in /var/lib/lightdm looks correct.

[11:33:08] user@machine:[/var/log/lightdm]$ sudo ls -al /var/lib/lightdm/
total 44
drwxr-x---  9 lightdm lightdm 4096 2011-10-18 11:14 .
drwxr-xr-x 74 root    root    4096 2011-10-18 11:15 ..
drwx------  4 lightdm lightdm 4096 2011-10-18 11:14 .cache
drwx------  3 lightdm lightdm 4096 2011-10-18 11:14 .config
drwx------  3 lightdm lightdm 4096 2011-10-18 11:14 .dbus
-rw-------  1 lightdm lightdm   16 2011-10-18 11:14 .esd_auth
drwx------  5 lightdm lightdm 4096 2011-10-18 11:15 .gconf
d?????????  ? ?       ?          ?                ? .gvfs
drwxrwxr-x  3 lightdm lightdm 4096 2011-10-18 11:14 .local
drwx------  2 lightdm lightdm 4096 2011-10-18 11:14 .pulse
-rw-------  1 lightdm lightdm  256 2011-10-18 11:14 .pulse-cookie
-rw-------  1 lightdm lightdm   49 2011-10-18 11:14 .Xauthority



Edit (20 Jan 2012):
I stumbled into another problem with LightDM after uninstalling gnome-settings-daemon. It looks like the background file to set for LightDM is requested through gnome-settings-daemon for some reason on my system. So, if you have the same problem, a quick apt-get install gnome-settings-daemon will solve the problem.

Tuesday, September 27, 2011

Removing "RC" packages on Debian/Ubuntu

If you do "dpkg -l", sometimes you will get to see a long list of packages with the following details:
  • rc  package-name  0.4-3  package-details
Note the "rc" status at the beginning of the package description. Some packages will show up in the "dpkg -l" output even after removing them. The reason behind this is - packages with "rc" status indicate that the packages have been removed but some configuration files for those packages are left on the system.

To remove these packages, do the following:
  • sudo dpkg --purge package-name
For a list of packages, run the following:
  • dpkg -l | grep ^rc | cut -d ' ' -f3 | xargs sudo dpkg --purge








Thursday, July 14, 2011

Evince would not start over SSH X-forwarding

Evince, which is the primary PDF and PostScript viewer on Ubuntu, recently stopped working on my Ubuntu/Natty (11.04) over SSH X-forwarding. It works flawlessly inside 'gnome-session'. But, would not run as a regular application (e.g. xpdf or gv) over X-forwarded SSH.

After digging up a little bit, I found a lots of these message in my
dmesg output:

[1305902.871825] type=1400 audit(1310620543.587:75): apparmor="STATUS" operation="profile_remove" name="/usr/bin/evince" pid=20166 comm="apparmor

It was obvious that apparmor [1] was blocking Evince to run outside Gnome session over SSH. A solution to disable the AppArmor block on Evince over SSH connection was suggested here [2]:

#inside the gnome-terminal
sudo ln -s /etc/apparmor.d/usr.bin.evince /etc/apparmor.d/disable
sudo /etc/init.d/apparmor restart


And voila! Now Evince can again be launched over SSH.

[1] http://en.wikipedia.org/wiki/AppArmour
[2] http://ubuntuforums.org/showthread.php?t=1472642

Friday, January 14, 2011

Keyboard num-keys not working in VirtualBox Ubuntu guest

The solution that works for me is by disabling 'Mouse Keys'.
  • Go to System > Preferences > Keyboard.
  • In Mouse Keys tab, un-tick 'Pointer can be controlled using keypad'

Monday, September 6, 2010

Installing Ubuntu with AARNET mirror

This post applies to you, only if ...
  • you are in Australia 
  • and you want to use AARNET's  mirror (which for many people would work a lot faster than the standard Australian Ubuntu mirror)
 Default Ubuntu installation provides the standard AU mirror for Australians. To use AARNET, you have to enter the following details manually during installation:
  1. Protocol: http (ftp should also be supported but I haven't tested it)
  2. Mirror address: mirror.aarnet.edu.au
  3. Mirror path: /pub/ubuntu/archive/ (don't drop the slashes, type them as shown)




Tuesday, August 17, 2010

Debian/Ubuntu: Delay in getting SSH login prompt

On some of my Debian/Ubuntu machines, I get an annoying 10-20 seconds delay in seeing the prompt while trying to login. My first guess was - something wrong in key exchange and it's must be falling back with standard password authentication, as can be seen with ssh -vv babil@servername

But the solution seems to be in disabling DNS resolution for the SSH server. I found the solution here: http://www.unix.com/linux/96010-delay-getting-ssh-login-prompt.html. /etc/ssh/sshd_conf needs a "UseDNS no" line, followed by a "sudo /etc/init.d/ssh restart".
Cheers.

Monday, April 26, 2010

Elsevier style with Lyx on Ubuntu 9.10

Elsevier style doesn't work out of the box on Ubuntu 9.10. Follow the steps below:

  1. mkdir elsarticle
  2. cd elsarticle
  3. wget http://www.elsevier.com/framework_authors/misc/elsarticle.zip
  4. unzip elsarticle.zip
  5. sudo cp *.sty /usr/share/texmf-texlive/tex/latex/elsevier/
  6. sudo cp *.cls /usr/share/texmf-texlive/tex/latex/elsevier/
  7. sudo cp *.bst /usr/share/texmf-texlive/tex/latex/elsevier/
  8. sudo texhash
  9. Run LyX, click Tools > Reconfigure
  10. Restart LyX
  11. File > New Document from Template ... select elsarticle.lyx ... it should work now ;-)

IEEEtran with Lyx on Ubuntu 9.10

If you are fighting to get IEEEtran.sty install and work with lyx, install the following packages to get (almost) everything working straight out of the box:

sudo apt-get install texlive texlive-base texlive-base-bin texlive-base-bin-doc texlive-bibtex-extra texlive-binaries texlive-common texlive-doc-base texlive-extra-utils texlive-font-utils texlive-fonts-extra texlive-fonts-extra-doc texlive-fonts-recommended texlive-fonts-recommended-doc texlive-formats-extra texlive-generic-extra texlive-generic-recommended texlive-humanities texlive-humanities-doc texlive-latex-base texlive-latex-base-doc texlive-latex-extra texlive-latex-extra-doc texlive-latex-recommended texlive-latex-recommended-doc texlive-latex3 texlive-luatex texlive-math-extra texlive-metapost texlive-metapost-doc texlive-omega texlive-pictures texlive-pictures-doc texlive-plain-extra texlive-pstricks texlive-pstricks-doc texlive-publishers texlive-publishers-doc texlive-science texlive-science-doc texlive-xetex latex-beamer latex-xcolor latex-xft-fonts dblatex preview-latex-style

Tuesday, April 13, 2010

Ubuntu/Debian: Flash not responding to any click

I found the fix here: http://helpforlinux.blogspot.com/2009/11/i-cannot-click-on-flash-in-ubuntu.html

As instructed, perform the following and restart your firefox:
  • Hit ALT+F2 and enter
  • gksudo gedit /usr/lib/nspluginwrapper/i386/linux/npviewer
  • add the following line BEFORE the last line of text
  • export GDK_NATIVE_WINDOWS=1
  • Save.
  • Restart any applications using flash

Wednesday, March 31, 2010

Ubuntu (jaunty/9.04) - Delay in print dialog

We use a 'Konica Minolta c451' printer at work and I have been having this issue since I upgraded to Ubuntu 9.04 (Jaunty). The bug has been reported here: https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/475845

The temporary recommended solution is to comment out the following in /etc/cups/cupsd.conf:
##Listen /var/run/cups/cups.sock

Thursday, February 18, 2010

Ubuntu/Debian :: watching trailers from Apple

apt-get install mplayer mozilla-mplayer

Tuesday, February 9, 2010

Debian/Ubuntu: highlight and publish source codes

The tool is called - "highlight"

apt-get install highlight
man highlight
Perfect for publishing, integrating source-codes in tex and on websites. I like the following for my codes:

highlight --pretty-symbols --inline-css -I -l _FILE_NAME_ --style $ide -V > tmp; firefox tmp &
In firefox, one can do "View Page Source" and copy&paste.