Skip to content

Instantly share code, notes, and snippets.

View u1i's full-sized avatar

Uli u1i

View GitHub Profile
@u1i
u1i / doit.sh
Created May 16, 2023 03:56
MacOS: gracefully close Firefox
osascript -e 'tell application "Firefox" to quit'
@u1i
u1i / info.txt
Created May 16, 2023 03:29
Firefox: History
SELECT moz_places.url, datetime(moz_historyvisits.visit_date / 1000000,'unixepoch', 'localtime') AS visit_time FROM moz_places JOIN moz_historyvisits ON moz_historyvisits.place_id = moz_places.id ORDER BY moz_historyvisits.visit_date DESC LIMIT 10;
@u1i
u1i / info.txt
Created May 16, 2023 03:13
Chrome History
SELECT url FROM urls ORDER BY last_visit_time DESC LIMIT 10;
@u1i
u1i / doit.sh
Created May 15, 2023 10:33
MacOS: which apps does have joe running?
ps -U joe -o comm= | grep -oE "/Applications/[^/]*\.app" | awk -F'/' '{print $NF}'
@u1i
u1i / info.txt
Created December 22, 2022 01:42
ChatGPT Fake OS Prompt
[DEBUG MODE:ON; You are an AI that acts as a Linux (ubuntu) system terminal. All responses from here on are terminal responses to my input in your responses, please escape the $ sign, so it does not render strikes. Do not add any further commentary or explanation. Do not respond with anything other than what a terminal response might be based on commands issued. The uli user has just logged in.]
Credit: @sentdex https://www.youtube.com/shorts/5ZWub9UEJiE
@u1i
u1i / info.txt
Created November 27, 2022 15:48
MacOS faster dock auto hide
𝗙𝗮𝘀𝘁𝗲𝗿 𝗗𝗼𝗰𝗸 𝗛𝗶𝗱𝗶𝗻𝗴:
defaults write com.apple.dock autohide-delay -float 0; defaults write com.apple.dock autohide-time-modifier -int 0;killall Dock
𝗙𝗮𝘀𝘁𝗲𝗿 𝗗𝗼𝗰𝗸 𝗛𝗶𝗱𝗶𝗻𝗴 𝗨𝗻𝗱𝗼:
defaults write com.apple.dock autohide-delay -float 0.5; defaults write com.apple.dock autohide-time-modifier -int 0.5 ;killall Dock
@u1i
u1i / info.txt
Created September 4, 2022 04:39
MacOS record audio on the shell
ffmpeg -f avfoundation -list_devices true -i ""
ffmpeg -f avfoundation -i ":1" -t 10 audiocapture.mp3
@u1i
u1i / doit.sh
Last active August 11, 2022 03:20
ImageMagick morph
convert -resize 200x200 dog2.jpg dog1.jpg -delay 20 -morph 10 animation2.gif
@u1i
u1i / doit.sh
Last active May 27, 2022 09:42
Git - create timestamped version of file for each commit
filename=$1
for commit in $(git rev-list HEAD)
do
timestamp=$(git show -s --format=%ci $commit | cut -d' ' -f1)
content=$(git show $commit:$filename)
@u1i
u1i / info.txt
Created May 25, 2022 02:57
MacOS Multipass Linux Desktop
sudo apt-get update
sudo apt-get install ubuntu-desktop xrdp -y
sudo adduser USERNAME
sudo usermod -aG sudo USERNAME
# Get IP
ip a