Author: stamatis

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  

Fixing partition size mismatch error

Many times, after cloning a partition using dd, we get warnings and error messages about a size mismatch between the physical partition size and the one contained in the partition table. To alleviate the issue, apart from using gparted, parted, partx and whatnot, we can use a terminal, to

Older Distributions Repositories – Debian

As root, edit /etc/apt/sources.list and change the ftp.debian.org entries to archive.debian.org, as follows: deb http://archive.debian.org/debian/ <name> main non-free contrib deb-src http://archive.debian.org/debian/ <name> main non-free contrib deb http://archive.debian.org/debian-security/ <name>/updates main non-free contrib deb-src http://archive.debian.org/debian-security/ <name>/updates main non-free contrib Note that you need to substitute <name> with the codename of the distribution you are interested in As root, run: apt-get install debian-archive-keyring and once done, again as root run: apt-get update and you’re ready for doing any installs / upgrades to your system.

Implement .xsessionrc on Raspbian

A script within /etc/X11/Xsession.d called 75source-profile causes any changes to the $PATH made inside $HOME/.xsessionrc to be lost, as it reads $HOME/.profile after the $PATH is altered. The correct way to deal with this is to rename  or copy the 40×11-common_xsessionrc to a file with higher serial number that will run after the 75, for instance 80×11-common_xsessionrc and implement any changes to the $PATH within $HOME/.xsessionrc, thus: for UBIN in $HOME/bin $HOME/.local/bin; do { [ -d “$UBIN” ] && export PATH=$UBIN:$PATH }; done This will ensure that if any of the directories $HOME/bin and $HOME/.local/bin exist will be appended in the beginning of the $PATH Furthermore, to avoid duplication of those directories in the $PATH, it is necessary to edit $HOME/.profile and comment out the section that reads: # set PATH so it includes user’s private bin directories if [ -d “$HOME/bin” ]; then   PATH=$HOME/bin:$PATH fi Like this: # set PATH so it includes user’s private bin directories #if [ -d “$HOME/bin” ]; then #  PATH=$HOME/bin:$PATH #fi Finally, edit $HOME/.bashrc and add the following at the end: for UBIN in $HOME/bin $HOME/.local/bin; do { [[ -d $UBIN ]] \ && [[ ! $PATH =~ $UBIN ]] \ && PATH=$binDir:$PATH }; done That’s it! Congratulations, now you

Continue readingImplement .xsessionrc on Raspbian

AUTO_INCREMENT tricks

Say, on a mysql database, there’s a table example_table that contains a field example_id of type auto_increment and for some reason, one wants the next value of the auto_increment to be a specific value (x ≥ 0), then, they can do the following in a mysql session: alter table example_table auto_increment x; If the above table is not void of data and the current value of the auto_increment is y, one can run the above code, for any x > y only, otherwise an error is produced. NOTE, if a table has been emptied with the truncate statement, then the auto_increment is reset to the value 1.