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

SnapdropPairdropSharedropFile.pizza


Hide Files & Folder on Mac

Date: 08/10/2023

chflags hidden <path>
chflags nohidden <path>

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

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

cat /var/lib/jenkins/secrets/initialAdminPassword

Format USB

Date: 25/07/2023

Check format : sudo fsck /dev/sdb1


MySQL on macOS

Date : 22/07/2023


Understanding Celsius

Date : 18/07/2023

Step 1: Memorize the benchmarks

Step 2: Math


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

  1. In URL bar type about:config & hit enter
  2. Search for dom.event.contextmenu.enabled
  3. Toggle to False.

Flush DNS

Date : 30/06/2023