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, 25 June 2019

Linux mouse gpm

The following gets the mouse working in the console;

gpm -m /dev/input/mice -t imps2

https://www.linuxquestions.org/questions/slackware-14/setting-up-a-usb-mouse-in-slackware-401496/

put the following in rc.gpm and make bootable - chmod +x /etc/rc.d/rc.gpm

#!/bin/sh
# Start/stop the GPM mouse server:

if [ "$1" = "stop" ]; then
echo "Stopping gpm..."
gpm -k
else # assume $1 = start:
echo "Starting gpm..."
gpm -m /dev/mouse -t imps2
fi


Finally do ln -si /dev/input/mice /dev/mouse to create link
For usb /dev/mouse points to /dev/input/mice
For PS/2 /dev/mouse points to /dev/psaux


Optionally add/comment the following lines in /etc/X11/XF86Config for usb

#Option "Protocol"    "PS/2"
#Option "Device"      "/dev/psaux"
Option "Protocol" "imps/2"
Option "Device" "/dev/mouse"


Slightly related note: for keyboard, the following should be present:
#Option "XkbLayout"  "us"
Option "XkbLayout"  "uk"

Tuesday, 18 June 2019

backup and restore mysql

Backup;
mysqldump -u [username] -p [databaseName] > [filename]-$(date +%F).sql
 
Restore; 
mysql -u [username] -p [databaseName] < [filename].sql

See here for more details...

Saturday, 27 April 2019

Categorical and Continuous Variables - Nominal, Dichotomous, Ordinal, Interval, Ratio

Categorical and Continuous Variables

Categorical variables are also known as discrete or qualitative variables. Categorical variables can be further categorized as either nominalordinal or dichotomous.

Friday, 22 February 2019

Linux - remount filesystem rw

mount -o remount,rw / (might have used only w)

lilo.conf - Check boot parameter is correct /dev/sd* matches where drive is connected.
run lilo from /boot (if need be use lilo -b /dev/sd* where sda is the drive not the partition.
Check root = /dev/sd* is the correct partition

Check /etc/fstab has correct /dev/sd* entries
 

Wednesday, 23 January 2019

Normalization Normal forms

First Normal Form 1NF

No repeating columns or columns contain only a single value.


Second Normal Form 2NF

As per 1NF but each non PK value can be uniquely identified by the PK

Third Normal Form 3NF

As per 2NF but each no PK value can ONLY be identified by the PK

Comparison between SQL and Pandas

Comparison with SQL


Thursday, 10 January 2019

VirtualBox command line. Removing innaccessable VMs change machine location

To delete virtual machines from the command line, first I removed the *.vbox *.vmdk files etc (basically the folder that these files are in).

Then;
VBoxManage list vms (this lists virtual machines)
VBoxManage unregistervm ********* (where *** is the number of the VM as shown by the previous command).

To change default location of VM's
vboxmanage setproperty machinefolder /path/to/directory/
Note use path in quotation marks if folder needs a space, example;
vboxmanage setproperty machinefolder "/var/VirtualBox VMs"

Friday, 4 January 2019

Mac add Open With to Right Click menu

Add OPEN WITH to Right click menu
  1. Open Automator and select Service document type.
  2. Select Files and Folders in the top Service receives selected menu
  3. Search for and select the Open Finder Items action.
  4. Now select TextEdit in Open with:
  5. Save the service with a name you want to see in the menus
You can now find this by: 
  • Right-clicking the file > Services