Tuesday, 14 August 2018
Installing latest version of git on Centos
The Centos repo for git is waaay out of date. Here's how to download an up to date version.
sudo yum -y install epel-release
sudo yum -y groupinstall development
sudo yum -y install curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel asciidoc xmlto docbook2X wget
sudo ln -s /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi
obtain the URL of the version of git that you want to use from https://github.com/git/git/releases
wget <url of git release> -O git.tar.gz
tar -xvf git.tar.gz
cd git*
make all doc prefix=/usr && sudo make install install-doc installhtml install-man prefix=/usr
then run git --version to check if you are now on the one you want.
Thursday, 26 July 2018
Fixing a PC Keyboard on a Mac (Home and End keys)
Ensure your Mac has ben set up with a <countryname> PC keyboard profile in preferences.
Then edit (or create) the file ~/Library/KeyBindings/DefaultKeyBinding.dict
{
"\UF729" = moveToBeginningOfParagraph:; // home
"\UF72B" = moveToEndOfParagraph:; // end
"$\UF729" = moveToBeginningOfParagraphAndModifySelection:; // shift-home
"$\UF72B" = moveToEndOfParagraphAndModifySelection:; // shift-end
"^\UF729" = moveToBeginningOfDocument:; // ctrl-home
"^\UF72B" = moveToEndOfDocument:; // ctrl-end
"^$\UF729" = moveToBeginningOfDocumentAndModifySelection:; // ctrl-shift-home
"^$\UF72B" = moveToEndOfDocumentAndModifySelection:; // ctrl-shift-end
}
Reboot, and your home and end keys should be working perfectly!
Then edit (or create) the file ~/Library/KeyBindings/DefaultKeyBinding.dict
{
"\UF729" = moveToBeginningOfParagraph:; // home
"\UF72B" = moveToEndOfParagraph:; // end
"$\UF729" = moveToBeginningOfParagraphAndModifySelection:; // shift-home
"$\UF72B" = moveToEndOfParagraphAndModifySelection:; // shift-end
"^\UF729" = moveToBeginningOfDocument:; // ctrl-home
"^\UF72B" = moveToEndOfDocument:; // ctrl-end
"^$\UF729" = moveToBeginningOfDocumentAndModifySelection:; // ctrl-shift-home
"^$\UF72B" = moveToEndOfDocumentAndModifySelection:; // ctrl-shift-end
}
Reboot, and your home and end keys should be working perfectly!
Monday, 7 May 2018
Ubuntu 18.4 - Right click doesn't work on the touchpad
A very quick fix, for a very silly default behaviour...
By default, Ubuntu has been set up to respond to two finger taps as a secondary / right click. Ah there's nothing like trying to alienate Windows users eh?
To fix this behaviour, you need to install the Gnome Tweaks tool.
You can do this in the terminal with:
Or just hit the Windows key and type 'tweak' and select Gnome Tweak
Once installed, run the app, go to Keyboard and Mouse and chnage the Mouse Click Options to Area.
Boom! Right click is behaving like it should :)
By default, Ubuntu has been set up to respond to two finger taps as a secondary / right click. Ah there's nothing like trying to alienate Windows users eh?
To fix this behaviour, you need to install the Gnome Tweaks tool.
You can do this in the terminal with:
$ sudo apt install gnome-tweak-tool
Or just hit the Windows key and type 'tweak' and select Gnome Tweak
Once installed, run the app, go to Keyboard and Mouse and chnage the Mouse Click Options to Area.
Boom! Right click is behaving like it should :)
Saturday, 13 January 2018
Automatically remove old kernels versions
Centos
sudo yum install yum-utils -ysudo package-cleanup --oldkernels --count=2
Ubuntu
Free up space if you don't have any on your /boot partition
Find out which kernel you are running uname -r
Delete files that are not related to that kernel (e.g. rm *-79-*)
Now you have space you can run apt-get autoremove --purge
if you have any errors coming up add -f to force the command to complete
finally, stop it happening again by editing /etc/apt/apt.conf.d/50unattended-upgrades and changing:
//Unattended-Upgrade::Remove-Unused-Dependencies "false";
to
Unattended-Upgrade::Remove-Unused-Dependencies "true";
Thursday, 5 October 2017
Get graylog running on port 80 instead of 9000
If you are building a single service server (and if you are doing anything with log files the chances are that you are... then you might want to get Graylog working on a convenient port, like 80 rather than the default 9000.
By default ports below 1024 are privileged and normal applications are not allowed to run on them.
If you search the internet there are loads of conversations about how to do it the right way... well that is too complicated for me, so here's a quick and dirty way to get it set up.
Just run the service using the root user rather than the graylog user - yeah I know, all kinds of a bad idea if this is externally facing, but if it's internal then I think it'll be alright.
In Ubuntu:
sudo vim /etc/graylog/server/server.conf
Change the port number for rest_listen_uri and web_listen_uri to 80
sudo vim /usr/lib/systemd/system/graylog-server.service
Change
User=graylog to User=root
Group=graylog to Group=root
Exit and run
systemctl deamon-reload
to apply the changes you just made
By default ports below 1024 are privileged and normal applications are not allowed to run on them.
If you search the internet there are loads of conversations about how to do it the right way... well that is too complicated for me, so here's a quick and dirty way to get it set up.
Just run the service using the root user rather than the graylog user - yeah I know, all kinds of a bad idea if this is externally facing, but if it's internal then I think it'll be alright.
In Ubuntu:
sudo vim /etc/graylog/server/server.conf
Change the port number for rest_listen_uri and web_listen_uri to 80
sudo vim /usr/lib/systemd/system/graylog-server.service
Change
User=graylog to User=root
Group=graylog to Group=root
Exit and run
systemctl deamon-reload
to apply the changes you just made
Sunday, 1 October 2017
Touchpad settings keep reverting - scroll in the wrong direction
I love my HP Envy, but I hate the way that the touchpad settings keep switching back after a few weeks.
This is due to the latest Synaptics touchpad drivers being loaded and it overwriting the settings. This is particularly noticeable as the scroll direction switched to "reverse"... honestly Synaptics why would you force reverse settings on anyone when it's obviously not the "right" way!
Anyway, enough about my pet peeves... how do you fix it.
Simple!
Open up regedit and go to:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Synaptics\SynTP\Install
Change the setting DeleteUserSettingsOnUpgrade from 1 to 0#
Exit out of regedit, and that should be all you need to do. Your settings will not be overwritten when you get a new version of the touchpad driver.
This is due to the latest Synaptics touchpad drivers being loaded and it overwriting the settings. This is particularly noticeable as the scroll direction switched to "reverse"... honestly Synaptics why would you force reverse settings on anyone when it's obviously not the "right" way!
Anyway, enough about my pet peeves... how do you fix it.
Simple!
Open up regedit and go to:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Synaptics\SynTP\Install
Change the setting DeleteUserSettingsOnUpgrade from 1 to 0#
Exit out of regedit, and that should be all you need to do. Your settings will not be overwritten when you get a new version of the touchpad driver.
Monday, 17 July 2017
Using redis failover with F5 and Kemp load balancers
I normally use an F5 for all my load balancing needs, but recently found myself needing to use a Kemp.
Setting up an F5 is easy, just create a pool, and set up monitor like so:
Setting up an F5 is easy, just create a pool, and set up monitor like so:
Basically this detects which node is the master and sets it as the only node active. Upon a failover, there will be a short outage and a new node will be elected and come online.
The principal is the same for the Kemp LB, but unfortunately you cannot send clear text.
You need to set:
Real Server Check Method: Binary Data
Checked Port: 6379 (or whatever port you are using)
Data to Send: 696e666f0d0a717569740d0a (this is the binary equivalent of the info command)
Reply Pattern: 726f6c653a6d6173746572
Find Match Within: 0
Your redis should now be working with your Kemp
Note that this does not work with Authenticated sessions.
Subscribe to:
Posts (Atom)


