Setting up VNC for GDM Login

Nov 12, 2009
Tested on: Ubuntu 9.10 (Karmic Koala)

Ubuntu has a Remote Desktop server (Vino), which can be easily configured. But personally I found it to be too slow (even on 100Mbps connection) and there is no option to get it up & running before actual GDM login. One of the faster alternatives is x11vnc. It allows one to view remotely and interact with real X displays with any VNC viewer. Following are the steps to enable x11vnc immediately after GDM (or XDM, KDM etc) loads. We will be effectively using XDMCP over VNC.
  1. Enable XDMCP
    • Older Ubuntu version: System->Administration->Login Screen Setup-> Tab XDMCP->Enable XDMCP. You can disable "Honor Indirect Requests".
    • Karmic Koala: There is no XDMCP Tab in settings. So add "Enable=true" in [xdmcp] section of /etc/gdm/custom.conf (or gdm.conf for older version of GDM). Check here for detailed instructions.
    • For others, just look through the settings and find XDMCP, make sure it's enabled.
  2. Disable Desktop Sharing with Vino under System -> Preferences -> Remote Desktop. Install x11vnc from repository.
  3. Create password for VNCsudo x11vnc -storepasswd yourpasswordhere /etc/x11vnc.pass
  4. Configure GDM to run x11vnc when it loads:sudo nano /etc/gdm/Init/Default & add this line to the file just before exit 0:/usr/bin/x11vnc -nap -bg -many -repeat -clear_keys -rfbauth /etc/x11vnc.pass -rfbport 5900
  5. Edit gdm configuration to make sure that x11vnc is not killed after being started.sudo nano /etc/gdm/custom.conf Add / edit KillInitClients option in the [daemon] section to:KillInitClients=false Also check this FAQ for recent changes and other workarounds in x11vnc regarding KillInitClients.
  6. Restart gdm (you can just reboot), and you are good to go.
Few things to be noted:
  1. x11vnc does NOT have any options for locking the server machine's display on connection with client. If this is an important security issue then other vnc servers like vino, tightvnc etc should be used. Refer comments for more details.
  2. You may experience endless key repetition / key pressing when logged from a client. Use "-repeat" options with x11vnc to check this behavior. Check this discussion for other alternatives.
  3. I experience initial delay (about 6-7 secs) in response from x11vnc whenever I try to make a new connection. Though, it responds nicely after initial glitch.
Edits:
17 Jan, 2010: [debug] changed to [daemon], as it makes more sense according to GDM manuals.
18 Jan, 2010: Added FAQ link in step 5.


Read more ...

Code Block for Blogger / Blogspot

Nov 12, 2009
Added following to template (Layout->Edit html) in body section: code { font-family: Courier; margin:.75em 0; border:1px dashed #CCC; padding:5px 15px; display: block; background-color: #F4F5F7; overflow: auto; white-space: pre; } Above box itself is result of <code>...</code> tag.

An example:code block retains the whitespace & any other formatting in plain text.
Another Example:T h i s is a realllllllllllllllllyyyyyyyy looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooonnnnnnnnnnnnnnnngggggggggggggggg cooooooooooooooooooooode block
This is output of<blockquote> ... </blockquote>
blockquotes does NOT retains the whitespace OR any other formatting in plain text.

Note: Any HTML code between <code></code> is also treated as HTML. Use this HTML encoder to encode to HTML code before posting. Or, paste the HTML code in Compose tab (not in "Edit HTML" tab) of the post editor (Make sure that you have selected "Show HTML literally" in Compose Settings under Post Options).
Read more ...

Install style files in LyX

Sep 19, 2009

LyX is a frontend to LaTeX and so installation of any style file in LyX essentially mean: (1) installation of that style file in underlying LaTeX; and then (2) getting that style file work in LyX (using LyX layout files). Installation method for different types of style files are given below:

Install LaTeX class (.cls)
  1. create new directory with name <your-class-name> under /usr/share/texmf-texlive/tex/latex/
  2. copy <your-class-name>.cls file (& other files, if present) in the new directory
  3. sudo texhash
  4. create  a file <your-class-name>.layout in ~/.lyx/layouts
  5. edit the layout file according to the instructions given in Chapter 5 of "Customizing LyX: Features for the Advanced User" (Help->Customization in LyX).
  6. open LyX and click 'tools -> Reconfigure' and restart LyX when done. The new Document Class should be available now.
For Example, to install IEEEconf class file, download the zip files from here. Create .cls file by executing 'latex IEEEconf.ins'. Copy the folder IEEEconf to /usr/share/texmf-texlive/tex/latex/. Run sudo texhash. Find IEEEtran.layout file & copy it to a new file named IEEEconf.layout in ~/.lyx/layouts (IEEEconf and IEEEtran are very similar, so IEEEtran-layout file can be used as layout file for IEEEconf). Edit the the second line in IEEEconf.layout from
# \DeclareLaTeXClass{article (IEEEtran)}
to
# \DeclareLaTeXClass{article (IEEEconf)}
and it should turn up when you reconfigure LyX.
Install LaTeX style (.sty)

Style file (.sty) is an addition to class files (.cls) files and they provides special formatting rules which overrides the similar rules in class  files, if present. So each style file must be associated with a class file. Installation process is similar to that of class files (see previous section of this post). Layout files (step 5 above) have different format. Instructions are given in Chapter 5 of "Customizing LyX: Features for the Advanced User" (Help->Customization in LyX).

For Example, to install ACRA style file, download the files from here. Copy the file acra.sty to /usr/share/texmf-texlive/tex/latex/ACRA/. Run sudo texhash. Find article.layout file & copy it to a new file named acra.layout in ~/.lyx/layouts (acra.sty uses "article" class). Edit the the second line in acra.layout from
#  \DeclareLaTeXClass{article}
to
#  \DeclareLaTeXClass[article, acra.sty]{article (ACRA)}
Then add in next line

Preamble
    \usepackage{acra}
EndPreamble


and it should turn up when you reconfigure LyX.

Install BibTeX Style (.bst)
  1. create new directory with name <your-bib-style-name> under /usr/share/texmf-texlive/bibtex/bst/
  2. copy <your-bib-style-name>.bst file (& other files, if present) in the new directory
  3. sudo texhash
  4. open LyX and click 'tools -> Reconfigure' and restart LyX when done.
  5. open LyX and click 'tools -> TeX Information' and choose BibTex Styles. Click 'Rescan' The new BibTeX should be available now.

Read more ...

Useful applications in Ubuntu

Sep 16, 2009

Read more ...

Disable Autorun & Autoplay in Xp

Sep 16, 2009
Prevents the spread of autorun.inf viruses from flash drives (or any kind of removable drives.
  • Autoplay: Download disable_autoplay.reg and double click to run. Accept yes to all dialog boxes. Restart your computer.
  • Autorun: Download disable_autorun.reg and double click to run. Accept yes to all dialog boxes. Restart your computer.
[ Reference(s): Link1, Link2, Link3, Link4 ]
Read more ...

Emacs Cheat Sheet

Sep 11, 2009
C-x is same as Ctrl-x
M-x is same as Alt-x
<#> represents a numeric value

FILE
   Open    C-x C-f
   Save    C-x C-s
   Save As    C-x C-w
   Save All    C-x s
   Close Buffer    C-x k
   Quit    C-x C-c
EDIT
   Undo    C-_
   Begin Selection    C-space
   Cancel Selection    C-g
   Cut Selection    C-w
   Cut Line (text on right side of the cursor)    C-k
   Paste / Yank    C-y
   Copy Selection to Numbered Clipboard    C-x r s <#>
   Paste from Numbered Clipboard    C-x r i <#>
   Forward Delete    Delete
   C-d
   Forward Delete Word    M-d
   Backward Delete    Backspace
   Backward Delete Word    C-Backspace
   M-Backspace
   M-Delete
   Complete word (based on words in open buffers)    M-/
Rectangle Edits
   Copy rectangle    C-x r r
   Cut / kill rectangle    C-x r k
   Paste / Yank rectangle    C-x r y
   Create blank rectangle    C-x r o
SEARCH
   Search / Move to next search hit    C-s
   Search / Move to previous search hit    C-r
   Regexp Search / Move to next hit    M-C-s
   Regexp Search / Move to previous hit    M-C-r
   Search and Replace    M-% then y for each replacement
                    ! to replace all
   Goto Line Number    M-x goto-line <#>
   M-g g <#>
   Move to previous matching bracket    M-C-b
   Move to next matching bracket    M-C-f
WINDOW
   Move to & fro in buffers    C-x right-arrow-key
   C-x left-arrow-key
   Choose Window    C-x, C-b
   Move to top of page    C-Home-key
   Move to bottom of page    C-End-key
   Move to beginning of current line    C-a
   Home-key
   Move to end of current line    C-e
   End-key
   Maximize / Display only one buffer    C-x 1
   Split Horizontal    C-x 2
   Split Vertical    C-x 3
   Switch Focus Between Windows    C-x o
   Activate Menu Bar     M-`
FORMATTING
   Indent Selection    M-C-\
   Convert to uppercase (till end of current word)    M-u
   Convert to lowercase (till end of current word)    M-l
   Capitalize Word
   (Convert 1st letter of word to uppercase)
   M-c
   Uppercase Selection    C-x, C-u
   Lowercase Selection    C-x, C-l


Other useful cheat sheets:

Emacs configuration files:
Read more ...

Change default Home, Desktop and documents path in Ubuntu

Sep 11, 2009
  • Edit ~/.config/user-dirs.dirs and set your desired path.
[ Reference(s): Ubuntuforums ]
 
Read more ...

ProFTPD Virtual User Setup with AuthUserFile

Sep 10, 2009
  1. Edit or add following to proftpd.conf
    AuthOrder mod_auth_file.c
    AuthUserFile /etc/proftpd/ftpd.passwd
    AuthGroupFile /etc/proftpd/ftpd.group
    RequireValidShell off
  2. Get uid and gid
    cat /etc/passwd | grep <username>
    cat /etc/group | grep <groupname>
  3. Add users to ftpd.passwd
    ftpasswd --uid <uid> --gid <gid> --gecos "Full Name" --name <username> --shell /bin/false --home <path> --passwd
  4. Add Groups to ftpd.group
    ftpasswd --gid <gid> --name <groupname> --group
  5. Add members to a group
    ftpasswd --gid <gid> --name <groupname> --member <membername> --group
  6. Set permissions on the ftpd.passwd and ftpd.group files
    chmod 400 /etc/proftpd/ftpd.passwd /etc/proftpd/ftpd.group
    chown proftpd.nogroup /etc/proftpd/ftpd.passwd /etc/proftpd/ftpd.group
  7. Restart ProFTPD
    /etc/init.d/proftpd restart
[ Reference(s): Link1, Link2 ]

Read more ...

Disable ipv6 in Ubuntu

Sep 10, 2009
  1. sudo gedit /etc/modprobe.d/aliases
  2. Find the line: alias net-pf-10 ipv6
  3. Edit this to: alias net-pf-10 off
  4. Save the file and reboot
  5. Check ipv6. There should not be any output to any of the following commands.
    ip a | grep inet6
    lsmod | grep v6
  6. change network.dns.disableIPv6 to true in about:config of Firefox.
[ Reference(s): Ubuntuforums ]
 
Read more ...

Picasa 3 behind proxy in Ubuntu

Sep 10, 2009
  1. cd to /opt/picasa/bin/ OR /opt/google/picasa/3.0/bin
  2. then execute: ./wrapper regedit
  3. navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
    edit or create binary/dword value ProxyEnable with value 1.
  4. edit or create string value ProxyServer with value proxy:port
    For example, if 144.16.192.245 is your proxy address and 8080 is port then set ProxyServer value as 144.16.192.245:8080
[ Reference(s): Picasa faq ]
Read more ...

Canon PIXMA iP1700 driver on Ubuntu

Sep 10, 2009
(or use windoze on virtualbox non-OSE edition with usb support)
  1. Add following lines to sources.list
    deb http://mambo.kuhp.kyoto-u.ac.jp/~takushi/ubuntu ./
    deb-src http://mambo.kuhp.kyoto-u.ac.jp/~takushi/ubuntu ./
  2. Install packages: libcnbj-2.6 bjfilter-2.6 pstocanonbj
  3. Use Canon iP2200 drivers in CUPS settings.
[ Reference(s): Link1, Link2, Link3 ]
 
Read more ...

Firefox - Addons

Sep 8, 2009
Use "Siphon" to sync addons across different computers.
  • Adblock Plus
  • AutoCopy
  • Auto Context -  user popup menu on text selection
  • AutoHideStatusbar
  • Bar Tab
  • Better Gmail
  • Better Youtube
  • Clear Cache button / Clear Private Data
  • Context Search - adds option to select search engine on right-click context menu
  • Define Word / Define
  • DownloadHelper
  • Download Statusbar
  • Fission
  • Flashblock
  • FlashGot
  • Gmark
  • Google Gears
  • Google Toolbar
  • Greasemonkey
  • Keyconfig
  • Menu Editor
  • Mouse Gestures Redox / All-in-one Gestures
  • Multiproxy Switch
  • Omnibar - adds capability similar to Google Chrome's location bar
  • Persona for firefox - Lightweight theme manager from Mozilla (in-built since Firefox 3.6)
  • Split Browser
  • Tab Mix Plus
  • URL Suffix - Continued
  • Voyage - History management
  • Weave / Firefox Sync
Read more ...

Hyperlinks on mouseover tooltips - Firefox

Sep 8, 2009
(Similar to Opera)
Note: This script conflicts with WYSIWUG editors (like google sites, blogspot editor) and adds a title (url of the link) to the links, each time the editor is loaded. Add these sites in the list "excluded sites" of the script from Greasemonkey preferences to avoid this.
Read more ...

Enable incompatible firefox-addons

Sep 8, 2009
(Due to firefox version check)
  • add new boolean key extensions.checkUpdateSecurity and set it to false in about:config page.
  • Starting from Firefox 3.6 new preference is used. Check MozillaZine page for details. Here are the steps for different versions:
    • Firefox 3.6 & later: add new boolean key extensions.checkCompatibility.<firefox-version> and set it to false in about:config page. (For example, for firefox 3.6 the key should be extensions.checkCompatibility.3.6)
    • Prior to firefox 3.6: add new boolean key extensions.checkCompatibility and set it to false in about:config page.
To add new boolean key, right click on about:config page -> New -> Boolean.
Read more ...

About Fluky-Logs

Aug 31, 2009
Disclaimer: The information in this web-log is often purely experimental and serve as a guideline to me. I am NOT responsible for any damage caused to any system on following these guidelines. You can follow these instructions at your own risk.

I respect intellectual property rights and copyrights. I usually put a set of references in each post (hyperlinked or otherwise) stating the source of information, if any. In case these information violates any rights, please inform me. I will take required action.

You can find more about me on my Google+ profile and can contact me by using the contact form below (or else follow this link).


Read more ...