Labels

Android (1) Apache (1) bash (2) boost (2) C (37) C++ (5) cheatsheet (2) CLion (6) css (3) Debian (34) DL (17) dns (1) Docker (3) Dreamweaver (2) Eclipse (3) fail2ban (5) git (6) GitHub (5) Hacking (4) html (8) http (1) iOS (1) iPad (1) IRC (1) Java (33) javascript (3) Linux (183) Mac (21) Machine Learning (1) mySQL (53) Netbeans (6) Networking (1) Nexus (1) OpenVMS (6) Oracle (4) Pandas (3) php (17) Postgresql (8) Python (9) raid (1) RedHat (15) Samba (3) Slackware (52) SQL (14) ssh (1) svn (1) tar (1) ThinkPad (1) Virtualbox (4) Visual Basic (2) Visual Studio (1) Windows (8) wire (1)

Tuesday, 20 June 2023

Copy file To Remote using ssh

scp

To copy a file from one local machine to a remote machine using ssh, do the following;

scp /local/path/to/file username@ip_address:/path/to/remote/destination

or if we wish to get a file from a remote machine to the local machine, we can do;

scp username@ip_address:/path/to/remote/file /local/path/to/destination

 

Wednesday, 31 May 2023

Add static route to windows

To add a static route to windows, do the following;

route add destination mask gateway metric interface

route add 23.128.16.0 255.255.240.0 23.128.16.1 IF 13

Note, in the above we are ignoring the metric.

The interface number can be found from;

netsh interface ipv4 show interfaces

Monday, 1 May 2023

Selecting distinct columns with MySQL

In the past I was sure it was not possible in MySQL to use DISTINCT on multiple columns, such as below;

SELECT DISTINCT a,b FROM my_table;

and have in the past, instead used something similar to the below as a workaround;

SELECT DISTINCT CONCAT (a,' ', b) FROM my_table;

However, it seems I am remiss and MySQL does indeed support DISTINCT on multiple columns.

 

Monday, 24 April 2023

Windows shares not connecting from Thunar in Linux

I came across an issue where Windows network shares would not open using Thunar file manager in Slackware.

With a fair bit of digging around, I eventually downgraded samba from 4.15.13 to 4.15.5 which in my case was what was installed with Slackware 15.


Monday, 20 March 2023

Cell Background colour not showing in LibreOffice Calc

This can be resolved in Tools>Options>LibreOffice>Accessibility and ensuring that Options For High Contrast Appearance is Disabled, as below;

Monday, 6 March 2023

Add custom command to nagios

 In this example, we add the plugin to check MySQL replication status [source]

Show mysql variables

We can show mysql variables with the following;

SHOW VARIABLES WHERE variable_name = 'some_variable';

SHOW VARIABLES LIKE '%some_variable%';

Example, to show the number of days binary logs are retained for;

SHOW VARIABLES WHERE variable_name = 'expire_logs_days';

Sunday, 19 February 2023

Set date as a string

The following format allows you to set the current date from a string;

sudo date -s '2023-01-14 11:22:00'

where the above date refers to 14th Jan 2023

Friday, 17 February 2023

Debian Archive

Debian archive for sources.list

http://archive.debian.org/debian-archive/debian/dists/ 

The sources.list file may look like (need to check the deb-src entries);

deb [trusted=yes] http://archive.debian.org/debian-archive/debian/ squeeze main non-free contrib

deb-src [trusted=yes] http://archive.debian.org/debian-archive/debian/ squeeze main non-free contrib

deb [trusted=yes] http://archive.debian.org/debian-archive/debian/ wheezy main non-free contrib

deb-src [trusted=yes] http://archive.debian.org/debian-archive/debian/ wheezy main non-free contrib

deb [trusted=yes] http://archive.debian.org/debian-archive/debian/ jessie main non-free contrib

deb-src [trusted=yes] http://archive.debian.org/debian-archive/debian/ jessie main non-free contrib

deb [trusted=yes] http://deb.debian.org/debian/ buster main non-free contrib

deb-src [trusted=yes] http://deb.debian.org/debian/ buster main non-free contrib


Also:

echo "Acquire::Check-Valid-Until "false";" >> /etc/apt/apt.conf.d/99no-check-valid-until
echo "Acquire::AllowInsecureRepositories "true";" >> /etc/apt/apt.conf.d/99no-check-valid-until
echo "APT::Get::AllowUnauthenticated "true";" >> /etc/apt/apt.conf.d/99no-check-valid-until

apt-key add /root/archive-key-6.0.asc (acquired from the keys.html link below *)

See also:

https://wiki.debian.org/SourcesList

https://ftp-master.debian.org/keys.html (* get key file from here and do apt-ket add key-file)