Facebook soon to be … RIPped

Some people never learn. Facebook is owner of Instagram, and is not respecting the law… again…

Nous tenions à vous informer que nous avons apporté quelques modifications à nos Conditions générales afin de les clarifier. L’objectif est d’aider les utilisateurs à mieux comprendre ce qui est autorisé sur Instagram et comment fonctionnent nos services. Ces Conditions générales entreront en vigueur le 20 décembre 2020. Passé cette date, toute utilisation de l’application aura valeur d’acceptation de ces conditions.

Facebook is provoking the authorities with this…. lets wait and see.

Add diskspace on CentOS 6.x

This procedure will only work if your configuration is using LVM. LVM is the default used during install, so this should be ok.

Start analyzing the usage of the disks.

fdisk -l

Shows that the volumes are on e.g. /dev/sda and that you are using an LVM system.

fdisk /dev/sda

In fdisk, create a new volume by pressing ‘n’. Create new primary partition (extended partition is not tested but should work). Change partition type by pressing ‘t’. Select partition type ‘8e’, this is Linux LVM.
Write down the results by pressing ‘w’ key. In case of doublt, press ‘m’ key to get help.

Now we need to re-read the partition table. Ether we restart the services or do a reboot.

shutdown -r now

After restarting the services, we check if all is ok and then proceed by creating the ‘Physical Volume Group’. The pvs command will show if it was created correctly. The example below assumes that your new partition is called /dev/sda4.

fdisk -l
pvcreate /dev/sda4
pvs

Now extend the volume group. Example assumes that name is VolGroup00, but fdisk will show you the exact name to be used. In case of doubt and you only have one volume group, the command vgs will show its name.

vgextend VolGroup00 /dev/sda4

Now extend its space, type the command vgdisplay to get the number of blocks to be extended. It should be displayed next to the label Free PE / Size. The example below assumes it shows Free PE / Size 3190 / xxxx.

vgdisplay
lvextend -l +3190 /dev/mapper/VolGroup00-LogVol00

After doing this, resize the file system. The command resize2fs assumes you are using ext4 which is the default.

resize2fs /dev/mapper/VolGroup00-LogVol00

Now check available disk space. It should be increased.

df

After finishing, do not forget to restart services or reboot.

shutdown -r now

Done !

Installing Code::Blocks on Linux Mint

Check what version of Mint you have:

cat /etc/debian_version

This should be Buster for the following to work. If you are on Stretch, please refer to: https://wxstuff.xaviou.fr/article/debian-repository.html

Import repository key:

wget -O- https://apt.xaviou.fr/key.asc | sudo apt-key add -

Create repository list:

sudo vi /etc/apt/sources.list.d/codeblocks.list

And insert following text:

deb https://apt.xaviou.fr/stable/ buster main
deb-src https://apt.xaviou.fr/stable/ buster main

Update your installation

sudo apt-get update

Now you are ready to install Code::Blocks from the packet manager or from the command line.

sudo apt-get install codeblocks

Bash tricks

Colouring grep output, modifying welcome message.

Reference on colours.

Some ways to do it

grep --color=always
grep --color -E 'pattern|$' file
grep --color 'pattern\|$' file
egrep --color 'pattern|$' file
export GREP_OPTIONS='--color=always' 

Alternatively, use ack. No file required, recursive by default.

ack -i pattern

The ultimate solution, use ack --cathy! Do not forget to install it first.

sudo apt-get install ack

Hardware information

Interesting article can be found here.

In summary, following commands will give you interesting details:

inxi -Fxz
lshw -short
lshw -C cpu
lspci -v -s 00:02.0
dmidecode -t memory
lshw -short -C memory

Upgrade MySQL from 5.1 to 5.5 on CentOS 6.x

Check installed version of mysql

rpm -qa | grep mysql

Enable the remi repository by modifying the enabled flag in the repo file:

vi /etc/yum.repos.d/remi.repo

After that, perform upgrade and verify new version. (several methods included below…)

yum -y update mysql*
rpm -qa | grep mysql
mysql --version
mysql -u root -p