How to run Firefox on Remote Host over SSH ? After $ ssh -X remotehost Run this script on remote host: #!/bin/bash export $(dbus-launch) export NSS_USE_SHARED_DB=ENABLED firefox -no-remote & This script credits to Waxborg: http://waxborg.servepics.com/opensuse/remote-administration/running-firefox-remotely-over-ssh.
Category: QA
Questions and answers.
Xen: Passing kernel parameters to DomUs
Posted onHow to pass kernel parameters to Xen DomUs ? Kernel paremeter may be needed to be passed to a Xen DomU. For example, when the DomU fails to boot and we want to check it in ‘single’ mode. We can simply start the DomU with the “extra=” syntax. For example, to add ‘single’ to the
Read more
How to convert a ps file to a pdf file
Posted onHow to convert a ps file to a pdf file that is available for publish (embedded fonts, etc)? Convert the file.ps ps file to file.pdf: $ ps2pdf -dPDFSETTINGS=/printer file.ps file.pdf</pre> Embedding Fonts in PDFs with pdflatex by Jeffrey P. Bigham: http://www.manticmoo.com/articles/jeff/programming/latex/embedding-fonts-with-pdflatex.php
Prevent Chrome closing after closing the last tab
Posted on How to prevent Chrome from closing itself after I close the last tab? This is a feature I want to have. This is a feature I want to have. Last Tab Standing plugin plays the trick: https://chrome.google.com/webstore/detail/last-tab-standing/dlopnnfglheodcopccdllffcijjeenkj If the last tab is closed, this extension stops Chrome from closing and instead opens the New
Read more
Synchronizing home directories
Posted onAny good tools to synchronize home directories on Linux boxes? Many have several PC/laptops and consequently many home directories. There is home directory synchronizing problem. unison is a good tool to do this: http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html#rshmeth http://www.watzmann.net/blog/2009/02/my-homedirs-in-unison.html http://www.cis.upenn.edu/~bcpierce/papers/index.shtml#File%20Synchronization Useful script: $ unison -batch -ui text ./ /mnt/homebak/zma/ In text user interface, synchronizing two directories in batch mode
Read more
Git: changing global user name and user email
Posted onHow to set the global user name and user email for git? We may be asked to set our global user name and user email if it is the first time that we use git on a machine: Your name and email address were configured automatically based on your username and hostname. Please check that
Read more
How to find Linux absolute path for a relative path
Posted onHow to find Linux absolute path for a relative path in Linux? We may need the absolute path on Linux when we only know the relative path. The readlink command does the trick. To find out the absolute path for a relative path, e.g. ./: $ readlink -f ./
Installing Dropbox on Linux
Posted onHow to install Dropbox on Linux ? Just follow Dropbox’s instruction here: https://www.dropbox.com/install?os=lnx A quick command for 64-bit Linux: $ cd ~ && wget -O – “https://www.dropbox.com/download?plat=lnx.x86_64” | tar xzf – Use the dropx CLI: http://www.dropboxwiki.com/Using_Dropbox_CLI Download dropbox.py: $ wget -O ~/bin/dropbox.py “https://www.dropbox.com/download?dl=packages/dropbox.py” Set the permissions: $ chmod +x ~/bin/dropbox.py Start Dropbox: $ dropbox.py start Status:
Read more
Chrome does not work with ibus
Posted onSeems the input method on Linux (ibus) does not work well with Chrome. But other programs, e.g. thunderbird, has not problem with ibus at all. What’s wrong with Chrome or ibus? Check whether the “Qt IBus library and Qt input method plugin” is installed. If not, installing it and restarting ibus may help: # yum
Read more
Large-but-correctly-aligned-and-optimized code is faster than less-bytes-per-instruction/opcode-packed code
Posted onIs large-but-correctly-aligned-and-optimized code faster than less-bytes-per-instruction/opcode-packed code? Alex Ionescu mentioned in ros-dev mailing list: I’m not sure why you would want kernel code to be “smaller” instead of “faster” though — on modern processors for cases like interrupts and such, large-but-correctly-aligned-and-optimized code is faster than less-bytes-per-instruction/opcode-packed code. ie: mov eax, [foo] add eax, 1 mov
Read more
SEEK_HOLE and SEEK_DATA: efficiently archive/copy large sparse files
Posted onHow to efficiently archive a very large sparse file, say 1TB? The sparse file may contains a small amount of data, say 32MB. SEEK_HOLE and SEEK_DATA The SEEK_HOLE/SEEK_DATA functionalities play the trick and makes `tar` and `cp` handle the large sparse file very efficiently. `lseek` with `SEEK_HOLE` returns the offset of the start of the
Read more
How to search bad blocks on a device?
Posted onIf I have a disk with bad blocks, how to search bad blocks on it under Linux? You can use ‘badblocks’: https://www.systutorials.com/docs/linux/man/8-badblocks/ badblocks [ -svwnf ] [ -b block-size ] [ -c blocks_at_once ] [ -e max_bad_blocks ] [ -d read_delay_factor ] [ -i input_file ] [ -o output_file ] [ -p num_passes ] [
Read more
How to install the MATE fork of Gnome 2 on Fedora 17?
Posted onI miss Gnome 2. How to install the MATE fork of Gnome 2 on Fedora 17? MATE is already included into Fedora 17’s repository and is an official feature of Fedora 18. To install MATE on Fedora 17 # yum install @mate-desktop To install softwares usually needed: # yum install mate-media mate-screensaver mate-system-monitor mate-power-manager mate-utils
Read more
Mmaping Memory Range Larger Than the Total Size of Physical Memory and Swap
Posted onIn Linux, mmap() is a system call that is used to map a portion of a file or device into the memory of a process. This can be useful for a variety of purposes, such as memory-mapped I/O, shared memory, and virtual memory management. However, when mapping a large range of memory that is larger
Read more
How to find hard links to a file
Posted onHow to find hard links to a file in Linux? To find out all hard links to file1: $ find /home -xdev -samefile file1 Read more: http://linuxcommando.blogspot.com/2008/09/how-to-find-and-delete-all-hard-links.html
Managing LVM
Posted onAny tutorials or tips on how to manage LVM? LVM provides a flexible and easy way to management storage disks on Linux. It also provides a set of tools for management. Here are some tutorials and references for managing LVM: LVM man pages: https://www.systutorials.com/docs/linux/man/8-lvm/#lbAL Manage Disk Volume in Linux: http://www.hongkedavid.com/blog/disk_volume.html LVM with Xen: https://www.systutorials.com/b/linux/tag/lvm/ Remove missing phyiscal volumes
Read more
How to test the connections between Linux hosts/servers?
Posted onHow to easily and quickly test the connection between two nodes on Linux? This should be specific to protocol and port. We can use nc (netcat) to test the connection between two servers. For example, to test whether TCP port 1048 can be used on the server (IP 10.0.3.48 as an example) side: On the server: $
Read more