Skip to content

Instantly share code, notes, and snippets.

@daniepetrov
daniepetrov / mousectl.c
Created November 14, 2024 09:46 — forked from taeber/mousectl.c
mousectl - Swap mouse buttons from the macOS Terminal
// mousectl - Swap mouse buttons from the macOS Terminal
// From https://superuser.com/a/1782251
// with changes by [email protected]
// Compile:
// clang -framework IOKit -framework Foundation -o mousectl mousectl.c
#include <IOKit/hidsystem/IOHIDLib.h>
#include <IOKit/hidsystem/IOHIDParameter.h>
@daniepetrov
daniepetrov / 1-dnsmasq-dnscrypt-proxy-setup.md
Created September 13, 2024 12:20 — forked from irazasyed/1-dnsmasq-dnscrypt-proxy-setup.md
How to Setup dnsmasq with dnscrypt-proxy and Cloudflare DNS on macOS

How to Setup dnsmasq with dnscrypt-proxy and Cloudflare DNS on macOS

Using Laravel Valet for localhost development, So it installs dnsmasq with it. dnsmasq runs on port 53, The default DNS port. So we setup dnscrypt-proxy on port 5300 with the default config files in this gist.

dnscrypt-proxy Installation

brew install dnscrypt-proxy
@daniepetrov
daniepetrov / encoding-video.md
Created June 5, 2024 14:38 — forked from Vestride/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@daniepetrov
daniepetrov / del_vscode_mac.md
Created June 4, 2024 21:04 — forked from karansinghgit/del_vscode_mac.md
How to completely uninstall VSCode on Mac
  1. Close and Quit VSCode

  2. Remove VScode from Applications (just go to Finder -> Applications and move VSCode to Bin)

  3. Execute these commands in any order. The paths might be slightly different for you.

rm -fr ~/.vscode*
rm -fr ~/Library/Application\ Support/Code/

rm -fr ~/Library/Saved\ Application\ State/com.microsoft.VSCode.savedState/
rm -fr ~/Library/Preferences/com.microsoft.VSCode.helper.plist 
# add your vpn password to .vpn_password file
echo "mypassword > ~/.vpn_password
chmod 600 ~/.vpn_password
# add these lines to .zshrc or .zprofile
function vpn-up() {
local VPN_HOST="host"
local VPN_USER="username"
local SERVER_CERT="pin-sha256:87+Hf09J6X30/vKmSGLPA35scH/jey/aP7zL4sQ+5+i="
@daniepetrov
daniepetrov / openconnect_mac
Last active July 4, 2023 15:36
Configure openconnect
# Use openconnect in favor of cisco anyconnect
# add vpn passdowd to macOS Keychain, change 'password' with your password
security add-generic-password -s openconnect_vpn -a $USER -w 'password'
# add these lines to .zshrc or .zprofile
function vpn-up() {
local VPN_HOST="host"
@daniepetrov
daniepetrov / acdisable
Created July 4, 2023 08:02 — forked from jasmas/acdisable
Enable/Disable Cisco AnyConnect Socket Filter Extension on MacOS
#!/bin/sh
echo Disabling vpnagentd...
sudo launchctl disable system/com.cisco.anyconnect.vpnagentd
echo Tearing down vpnagentd...
sudo launchctl bootout system /Library/LaunchDaemons/com.cisco.anyconnect.vpnagentd.plist
echo Deactivating Cisco AnyConnect Socket Filter Extension...
/Applications/Cisco/Cisco\ AnyConnect\ Socket\ Filter.app/Contents/MacOS/Cisco\ AnyConnect\ Socket\ Filter -deactivateExt
@daniepetrov
daniepetrov / WebstormTweak
Created March 11, 2023 09:37 — forked from glebcha/WebstormTweak
Speed up WebStorm
Here is my recipe how to speed up WebStorm:
Go to Preferences and do next:
Appearance & Behaviour > System Settings > Updates: disable auto update
Appearance & Behaviour > System Settings > Using Statistics: Uncheck allowing sending data
Editor > Live Templates: disable all, leave only what you are really use
Editor > Emmet: disable all emmets
Editor > Intentions: I leave only: CSS, Declaration, JavaScript and Language Injection
Plugins: leave only next (* - can be also disabled in case don't need them):
CoffeeScript *
@daniepetrov
daniepetrov / reinstall_git_brew.md
Created January 9, 2023 16:12 — forked from brandonsimpson/reinstall_git_brew.md
Re-installing Git on Mac OSX with Brew

Re-installing Git on Mac OSX with Brew

This is helpful if you've previously installed git from source on OSX, and other compilers can't find the correct path. You need to remove the current version of git, then re-install with brew.

Uninstall git if installed manually

  1. Check which git you're running:
    which git
    
@daniepetrov
daniepetrov / README.md
Last active June 14, 2023 06:04 — forked from hofmannsven/README.md
Increase key repeat rate on macOS

Increase key repeat rate on macOS

Settings: System Preferences » Keyboard » Key Repeat/Delay Until Repeat

Use the commands below to increase the key repeat rate on macOS beyond the possible settings via the user interface. The changes aren't applied until you restart your computer.

Source: https://apple.stackexchange.com/a/83923