Skip to content

Instantly share code, notes, and snippets.

@jasmas
jasmas / acdisable
Created January 26, 2022 17:29
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

WSL 2 Cisco AnyConnect Networking Workaround

Overview

WSL 2 uses a Hyper-V Virtual Network adapter. Network connectivity works without any issue when a VPN is not in use. However when a Cisco AnyConnect VPN session is established Firewall Rules and Routes are added which breaks connectivity within the WSL 2 VM. This issue is tracked WSL/issues/4277

Below outline steps to automatically configure the Interface metric on VPN connect and update DNS settings (/etc/resolv.conf) on connect/disconnect.

Manual Configuration

Set Interface Metrics

@LukasBombach
LukasBombach / Making Linaria work with Next js.md
Last active February 17, 2022 05:31
Making Linaria work with Next js

add linaria

yarn add -E linaria @zeit/next-css

.babelrc

{
@caseywatts
caseywatts / 0-self-publishing.md
Last active October 5, 2024 11:27
Self-Publishing via Markdown
@good-idea
good-idea / xstyled-styled-components.d.ts
Last active May 27, 2021 05:20
Type definitions for @xstyled/styled-components
declare module '@xstyled/styled-components' {
import _styled, {
StyledComponent,
ThemedStyledInterface,
ThemedStyledFunction,
DefaultTheme,
FlattenSimpleInterpolation,
} from 'styled-components'
export * from 'styled-components'
@dilverdev
dilverdev / env.js
Last active August 27, 2019 19:47
Configuration env in javascript
const envConfig = {
development: {
SITE_URL: 'http://localhost:3000',
API_URL: 'http://localhost:3000/api'
},
testing: {
SITE_URL: 'https://test.site.com',
API_URL: 'https://api.test.site.com'
},
production: {
@irazasyed
irazasyed / 1-dnsmasq-dnscrypt-proxy-setup.md
Last active September 13, 2024 12:20
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
@hofmannsven
hofmannsven / README.md
Created December 6, 2017 00:32
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

@shaik2many
shaik2many / javascript-localstorage-expiry.js
Created July 20, 2016 14:07
set timeout for localStorage or sessionStorage
http://apassant.net/2012/01/16/timeout-for-html5-localstorage/
var hours = 24; // Reset when storage is more than 24hours
var now = new Date().getTime();
var setupTime = localStorage.getItem('setupTime');
if (setupTime == null) {
localStorage.setItem('setupTime', now)
} else {
if(now-setupTime > hours*60*60*1000) {
localStorage.clear()
@scottming
scottming / capslock.ahk
Last active January 11, 2023 17:19
; Autohotkey Capslock Remapping Script
; Autohotkey Capslock Remapping Script
; - Deactivates capslock for normal (accidental) use.
; - Hold Capslock and drag anywhere in a window to move it (not just the title bar).
; - Access the following functions when pressing Capslock:
;Cursor keys - h, j, k, l
;Home,End - N, ;
;Page up,down - - =
;Esc - CapsLock only
;CapsLock - Space