Mini Notes
This is a collection of mini notes I maintain for future use including hacks, tweaks, code snippets & so on.
Quick File Sharing
Date: 18/01/2023
– Snapdrop – Pairdrop – Sharedrop – File.pizza
Hide Files & Folder on Mac
Date: 08/10/2023
chflags hidden <path>
chflags nohidden <path>
Print powerlevel10k colors
Date: 29/09/2023
for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done
- In ~/.p10k.zsh set typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique (change unique to last)
- Set POWERLEVEL9K_DIR_BACKGROUND=033
Copy files over SSH
Date: 14/09/2023
Copy files over SSH using scp
scp -i key.pem path/to/file user@host-ip:/path
Description lists in Markdown
Date: 11/08/2023
Description lists ain’t part of MD but are widely supported for eg by iA Writer
This is a title
: This is a description
This is another title
: This is another description
Default Jenkins Creds
Date: 07/08/2023
- Username: admin
- Pass:
cat /var/lib/jenkins/secrets/initialAdminPassword
Format USB
Date: 25/07/2023
Check format : sudo fsck /dev/sdb1
- FAT32 :
sudo mkfs.vfat /dev/sdb1
- NTFS :
sudo mkfs.ntfs /dev/sdb1
- exFAT :
sudo mkfs.exfat /dev/sdb1
MySQL on macOS
Date : 22/07/2023
- Install:
brew install mysql
- Start db:
brew services start mysql
- Access:
sudo mysql
- Using pass:
mysql -u root -p
Understanding Celsius
Date : 18/07/2023
Step 1: Memorize the benchmarks
- 0°C ~ 32°F (freezing point)
- 10°C = 50°F (cool)
- 20°C = 68°F (room temperature)
- 30°C ~ 86°F (warm)
- 40°C = 104°F (hot)
Step 2: Math
- Add 1.8°F for every 1°C (Example: 11°C ~ 51.8°F)
- Add 9°F for every 5°C (Example: 15°C = 59°F)
Download .m3u8 stream
Date : 12/07/2023
youtube-dl -f best -o file.mp4 --no-check-certificate <stream-URL>
Download All Images On The Page
Date : 03/07/2023
If you want to download all of the images that are on a webpage, open the Console tool, paste the following code, and press Enter
$$('img').forEach(async (img) => {
try {
const src = img.src;
// Fetch the image as a blob.
const fetchResponse = await fetch(src);
const blob = await fetchResponse.blob();
const mimeType = blob.type;
// Figure out a name for it from the src and the mime-type.
const start = src.lastIndexOf('/') + 1;
const end = src.indexOf('.', start);
let name = src.substring(start, end === -1 ? undefined : end);
name = name.replace(/[^a-zA-Z0-9]+/g, '-');
name += '.' + mimeType.substring(mimeType.lastIndexOf('/') + 1);
// Download the blob using a <a> element.
const a = document.createElement('a');
a.setAttribute('href', URL.createObjectURL(blob));
a.setAttribute('download', name);
a.click();
} catch (e) {}
});
Firefox - override sites that disable right click
Date : 02/07/2023
- In URL bar type
about:config
& hit enter - Search for dom.event.contextmenu.enabled
- Toggle to False.
Flush DNS
Date : 30/06/2023
- On Linux :
resolvectl flush-caches
- On Windows :
ipconfig /flushdns
- On MacOS :
sudo dscacheutil -flushcache