Skip to content

Instantly share code, notes, and snippets.

View tru2dagame's full-sized avatar
💭
🏀

Tru tru2dagame

💭
🏀
  • Ubiquiti
  • Shanghai
View GitHub Profile
@tru2dagame
tru2dagame / browser_history.md
Created December 20, 2022 17:09 — forked from dropmeaword/browser_history.md
Playing around with Chrome's history

Browser histories

Unless you are using Safari on OSX, most browsers will have some kind of free plugin that you can use to export the browser's history. So that's probably the easiest way. The harder way, which seems to be what Safari wants is a bit more hacky but it will also work for other browsers. Turns out that most of them, including Safari, have their history saved in some kind of sqlite database file somewhere in your home directory.

The OSX Finder cheats a little bit and doesn't show us all the files that actually exist on our drive. It tries to protect us from ourselves by hiding some system and application-specific files. You can work around this by either using the terminal (my preferred method) or by using the Cmd+Shft+G in Finder.

Finder

Once you locate the file containing the browser's history, copy it to make a backup just in case we screw up.

@tru2dagame
tru2dagame / safari_default_tab_list.scpt
Created December 10, 2022 19:04
Unfold Safari default tab list with apple script
tell application "System Events"
-- https://stackoverflow.com/questions/56188308/how-to-script-a-button-click-based-on-label-or-identifier
tell application process "Safari" to tell window 1
click UI element 1 of group 1 of toolbar 1
delay 1
try
if not (value of checkbox 1 of UI element 1 of row 1 of outline 1 of scroll area 1 of group 1 of splitter group 1 as boolean) then
click checkbox 1 of UI element 1 of row 1 of outline 1 of scroll area 1 of group 1 of splitter group 1
end if
on error
@tru2dagame
tru2dagame / README.md
Created January 13, 2021 17:45 — forked from nwade/README.md
Remove SentinelOne Agent - macOS High Sierra/Mojave

Warning - use at your own risk

Remove SentinelOne agent from Mac

  1. Boot into Recovery Mode by holding Cmd+R during reboot
  2. Open Terminal from top menubar
  3. Run /Applications/Utilities/Disk\ Utility.app/Contents/MacOS/Disk\ Utility to open Disk Utility
  4. If your startup disk is encrypted, use Disk Utility to mount it
  5. In Terminal, run chroot /Volumes/Macintosh\ HD
  6. Execute the deletion commands or script
@tru2dagame
tru2dagame / readme.md
Created July 26, 2019 09:58
ffmpeg youtube-dl

Youtube-dl part

go into download folder

cd ~/Downloads/

a. download directly by default settings (Most of these are 1280x720)

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name yourdomain
ssl_certificate /etc/ssl/localcerts/yourdomain.crt;
ssl_certificate_key /etc/ssl/localcerts/yourdomain.key;
ssl_ecdh_curve prime256v1;
ssl_session_cache builtin:1000 shared:SSL:10m;
@tru2dagame
tru2dagame / open_file_with_emacsclient.scpt
Last active February 16, 2020 18:23
Use apple script to open the selected file in finder with emacscilent
-- get the file path from the finder
tell application "Finder" to set theItems to selection
set thePaths to ""
repeat with i in theItems
set thisItem to POSIX path of (i as alias)
set thePaths to thePaths & thisItem & return
end repeat
set filePath to thePaths
-- remove \n of the file path
@tru2dagame
tru2dagame / readme.md
Created April 20, 2018 05:59
sysctl -p
sysctl -p
net.ipv4.ip_forward = 1
net.ipv4.conf.all.arp_notify = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.all.secure_redirects = 0
net.ipv4.conf.default.secure_redirects = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
@tru2dagame
tru2dagame / readme.md
Created April 6, 2018 09:06
Extract mkv to get the built-in subtitle
brew install --with-qt5 mkvtoolnix
mkvextract movie.mkv chapters --simple "My Chapters.txt" tracks -c MS-ANSI "2:My Subtitles.srt"
@tru2dagame
tru2dagame / wheezy-mips-toolchain
Created May 4, 2017 02:59 — forked from fgrep/wheezy-mips-toolchain
Debian wheezy mips toolchain
# Debian 7 MIPS Toolchain
# http://cdimage.debian.org/cdimage/archive/7.8.0/amd64/iso-cd/debian-7.8.0-amd64-CD-1.iso
# Basic install + SSH Server + Standard system utilities
# Update
mkdir /usr/src/mips-toolchain && cd /usr/src/mips-toolchain
apt-get update
apt-get upgrade
# Binutils
@tru2dagame
tru2dagame / docker-tinc.md
Created March 24, 2017 18:59 — forked from noteed/docker-tinc.md
Docker - Tinc setup