Category: Linux

Prevent CONNMAN messing with interfaces

Find in /etc/connman/main.conf the line which has the following: NetworkInterfaceBlacklist = … If it’s hashed (#) remove the # and put in there the interfaces that you DON’T WANT connman to manage, like for example: NetworkInterfaceBlacklist = …, enp3s1 Restart the networking service or reboot the machine

SAMBA configuration

Server Side Create operating system user accounts as per your requirements useradd -g … -d … -m -s … -k … username Create shares on the server, e.g. /mnt/Disk2/shareA /srv/samba/share3 Modify the /etc/samba/smb.conf according to your specifications Add samba users with smbpasswd or pdbedit smbpasswd -a username pdbedit -a -u username Modify permissions on the shares to match your requirements  

Barrier server – client configuration

Server: alpha Server configuration / command: barriers –name alpha –enable-crypto –address :24800 some distributions instead of the command barriers they use the command barrier.server Client: bravo Client configuration / command: barrierc –enable-crypto alpha:24800 some distributions instead of the command barrierc they use the command barrier.client  

Encrypt Files / Directories

Say we have a directory myStuff in our $HOME and we want to encrypt it and use it to store sensitive information. Run: encfs $HOME/myStuff $HOME/myEncryptedStuff This will prompt you to answer few questions for the encryption. The directory myEncryptedStuff will be used as mount point to the encrypted directory myStuff To unmount the encrypted directory, run: fusermount -u $HOME/myEncryptedStuff To remount it, run: encfs $HOME/myStuff $HOME/myEncryptedStuff To change password for the encryption, have the directory unmounted and run: encfsctl passwd $HOME/myStuff

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

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>