Author: stamatis

Fluxbox Backdrop / Background / Wallpaper

Say we have an image called mySuperCoolImage.png in $HOME/Pictures and we want to set it as backdrop in fluxbox We run fbsetbg -f $HOME/Pictures/mySuperCoolImage.png This will set the backdrop to our new image (see man fbsetbg) The above command should have inserted in $HOME/.fluxbox/lastwallpaper an entry for the image file, so when fluxbox restarts, will use our chosen wallpaper. If for any reason this is not the case, we can manually edit this file and place the name of our chosen image file in place.

Quick Search in Synaptic Package Manager

Say we are using Synaptic Package Manager with our distribution, but the Quick Filter is missing from it. We need to run: apt-get install apt-xapian-index and start Synaptic to check it out. If it still does not appear, we need to close Synaptic and run further: update-apt-xapian-index -vf and wait for it to finish. Starting Synaptic again, we should have Quick Filter available on the toolbar.

Linux install into, or boot from USB flash drive in VirtualBox

Requisites: You have a working installation of Oracle VirtualBox The directory you keep your virtual machines is $HOME/VM (our example) You have created a virtual machine called alpha (our example) that has no hard disk You have plugged in your USB stick and its device name is /dev/sdx (our example) Objectives: You want to install Linux on a USB flash drive from within VirtualBox OR: You want to boot a USB flash drive using VirtualBox Once the above requisites are met, run the following in a terminal: VboxManage internalcommands createrawvmdk -filename $HOME/VM/alpha/usbflash.vmdk -rawdisk /dev/sdx Run the Oracle VM VirtualBox Manager, select the alpha virtual machine and go to its Storage properties, then select the hard disk controller and add the newly created disk usbflash.vmdk Confirm all your changes and close the Storage properties. Start the alpha virtual machine and you will find that your USB flash drive now is attached as a hard disk that you can install Linux to, or boot from

LightDM headless XClient setup

Note: The following configuration is only to be used within a trusted network only, as it is not secure Requisites: Linux host alpha (our example) with X11 environment (XServer) Linux host bravo (our example) with LightDM installed (XClient) Objectives: Remotely connect to LightDM on Linux XClient from XServer Disable XClient display (optional) Edit /etc/lightdm/lightdm.conf on the XClient (bravo) and add the following to the appropriate sections: [LightDM] start-default-seat=false [SeatDefaults] xserver-allow-tcp=true [XDMCPServer] enabled=true On host bravo restart the lightdm service, by running either: service lightdm restart or invoke-rc.d lightdm restart or any other way that your distro provides to restart a service On host alpha run X :1 -query bravo and you should get a LightDM graphical login screen for bravo

Temporarily Disable HTML Anchor

To temporarily disable a link in a website that you’re authoring, say the code for the link is: <a href=”URL_goes_here”>URL</a> You can either use css like this: <a style=”pointer-events: none; cursor: default;” href=”URL_goes_here”>URL</a> Or use javascript like this: <a onclick=”return false” href=”URL_goes_here”>URL</a>

Include $HOME/bin in any Desktop Environment

In any Linux Desktop Environment, if you want to be able to run programs and scripts that reside in your own $HOME/bin via the <Alt>+<F2> you may have to do some configuration on your own, as sometimes desktops do not have this preconfigured. Edit or create $HOME/.xsessionrc and add into it the following: if [ -d “$HOME/bin” ]; then { PATH=$HOME/bin:${PATH##$HOME/bin:} }; fi export PATH Log out and log back into X and try to run the program by invoking <Alt>+<F2> and typing the name of your program or script and pressing <Enter>

Include $HOME/bin in the path for bash shell

Say we want to have our $HOME/bin added to the $PATH First check that the PATH does not already contain our $HOME/bin, by issuing in a terminal: echo $PATH If our $HOME/bin is contained in the $PATH we need to do nothing further, otherwise, proceed as follows: If you haven’t yet, create the directory bin in your home: mkdir bin Edit $HOME/.bashrc and add the following towards the end of the file: [[ -d $HOME/bin ]] && \ [[ ! $PATH =~ $HOME/bin ]] && \ PATH=$HOME/bin:$PATH && \ export PATH Edit $HOME/.profile or $HOME/.bash_profile and do the same. Log out of the system and log back in and check the path in a terminal: echo $PATH We should now find that the $HOME/bin is included in our $PATH, whether bash is used as a login shell or just as a terminal Also note that the [[ ! $PATH =~ $HOME/bin ]] condition prevents the $HOME/bin to appear more than once in our $PATH

Firefox JavaScript settings

In newer versions of Firefox, the javascript options to allow (or not) scripts to perform certain operations on the browser are accessible through about:config Prevent javascript from moving or resizing windows: dom.disable_window_move_resize true: block script, false: allow script Prevent javascript to raise or lower windows: dom.disable_window_flip true: block script, false: allow script Permit javascript to disable context menu (mouse right-click): dom.event.contextmenu.enabled false: block script, true: allow script

Properly run chroot in a hosted system

Say we want to chroot into a different environment residing under /mnt/testEnv which could either be a mounted filesystem or just a directory structure Run: mount -t proc proc /mnt/testEnv/proc Next: mount -o bind /dev /mnt/testEnv/dev Next: mount -t sysfs sys /mnt/testEnv/sys Next: mount -t devpts pts /mnt/testEnv/dev/pts Finally: chroot /mnt/testEnv