Labels

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

Sunday 31 May 2020

Find files in Linux

Basic use of the find command in Linux

To find a file named my file.txt anywhere;
find / -name "myfile.txt"

To find a file named my file.txt in the current directory;
find . -name myfile.txt

To find all files in the current directory;
find . -name *.txt

To find all jpg files in /home/plisken;
find /home/plisken -name *.jpg

To search the contents of files in current directory;
find . -type f -exec grep "keyword" '{}' \; -print

Tuesday 26 May 2020

Add to the shell PATH in MacOS

The following will add to the shell path in MacOS;

Open .bath_profile
(Don't forget [SHIFT + CMD + .] toggles displaying of hidden filed in finder.)

To ad a folder such as /Users/plisken/connectiq/bin we would add the following line to the end of .bash_profile;

export PATH="/Users/plisken/connectiq/bin:$PATH"

OR

export PATH=$PATH:/Users/plisken/connectiq/bin

and of course we can check the current $PATH by doing echo $PATH

Relaunching the terminal may be required...


Saturday 16 May 2020

PHP variables and scope

In php variables have scope (don't all languages)...

A variable declared outside of a function will not be available inside of a function, unless be declare it inside the function with the global command.

Wednesday 13 May 2020

Sync data from Fitbit to the Apple Health app.

What follows is a documented account on how to achieve reliable synching of data between the Fitbit and the Apple Health app.

A step by step of this project, how it came about, progress, problems and solutions along the way can be found here

Tuesday 12 May 2020

Monday 11 May 2020

Quickly add dir to OSX

A quick and dirty method of adding dir to a Mac is as simple as creating a link to /bin/ls

ls is located in /bin

By default we can't add or modify things there (topic for another time), but we can modify things in /usr/local/bin so where better a place to add a dir file/command...

goto /usr/local/bin
and do sudo ln -s /bin/ls dir

dir now exists in /usr/local/bin as a symbolic link to /bin/ls

Sunday 10 May 2020

Alternative methods of joining results from two tables


If we are wanting to pull information from two different tables that are linked in some way, the conventional way of doing this is as follows:

SELECT  table1.item, table2.item
FROM table1 JOIN table2 ON table1.item = table2.item;

However an alternative is to use the following;

SELECT  table1.item, table2.item
FROM table1, table2
WHERE table1.item = table2.item;


Saturday 9 May 2020

iPad keyboard click, camera should and lock screen sound not working

If the lock screen sound, keyboard click and camera sound aren't working on iPad, but you find other sounds are, such as music, ringtones etc, it is worth checking the control centre by swiping down from top right of screen as the system may have been muted.

It's important to note that while in this state, in settings, the keyboard click and lock screen sound options will still show as enabled.