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)

Thursday, 13 July 2023

Network Configuration in OpenBSD

Edit /etc/rc.conf

Change

ifconfig_em0="DHCP"

to

ifconfig_em0="inet 192.168.56.105 netmask 255.255.25.0"

and add

defaultrouter="192.168.56.1"

edit /etc/resolve.conf as per Linux and then do;

service netif restart && service routing restart

[source]

 

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';