Skip to content

Instantly share code, notes, and snippets.

@AppleBoiy
AppleBoiy / alias_eza.md
Last active May 19, 2024 22:59
eza-ls

Alias eza for ls command

Put to shell configure file

first install eza by homebrew

brew install eza

Basic setup

-- 1. Create a new generic password entry in Keychain Access called "WHATEVER_AnyConnect_VPN" (the name in Keychain access must match that in line 39 below) with your password for the Cisco AnyConnect VPN server.
-- 2. Open this script in Script Editor (both this and the above are in the Applications->Utilities folder) and "Save as.." an Application (.app) with desired name.
-- 3. Open Security & Privacy System Preferences, go to Privacy, Accessibility.
-- 4. Enable the above .app so it can access Accessibility
-- 5. Copy and paste a nice icon on the generic Applescript icon (I used a copy of the default AnyConnect one)
-- 6. Add the new .app to /Users/[yourshortname]/Applications with a shortcut to your Dock
-- 7. Enjoy the fast connection with no need to enter password and increased security of not having a sensitive password stored as plain text
-- 8. Run script again to close connection
-- AnyConnect now refered to as targetApp
When git commit gives this error:
error: insufficient permission for adding an object to repository database .git/objects
take back ownership of all Git objects by runnning:
cd <path-to-repo>
cd .git/objects
sudo chown -R <username>:<username> *
@doctor-house
doctor-house / SeleniumCapabilitiesSpoofing.cs
Last active May 19, 2024 22:54
Add se:cdp and se:cdpVersion to returned capabilities so devtools can work for selenoid grids
// Reach into the internal dictionary selenium uses for returned capabilities and add new entries
var host = new Uri("<your selenoid host>");
var sessionId = ((IHasSessionId) driver).SessionId.ToString();
var capabilitiesDictionary = (driver as WebDriver)?.Capabilities.GetFieldValue<Dictionary<string, object>>("capabilities");
capabilitiesDictionary["se:cdp"] = $"ws://{host}/devtools/{sessionId}/page";
capabilitiesDictionary["se:cdpVersion"] = capabilitiesDictionary["browserVersion"];
// Now devtools should work
var devToolsSession = ((IDevTools) driver).GetDevToolsSession();
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@rameezqazi23
rameezqazi23 / windows_activation.md
Created May 19, 2024 22:48 — forked from butageek/windows_activation.md
Activate Windows for free

For Windows 10

Step 1 - Open PowerShell or Command Prompt as administrator

Step 2 - Install KMS client key

slmgr /ipk your_license_key

Replace your_license_key with following volumn license keys according to Windows Edition:

@glennswest
glennswest / wineventlog.go
Created February 16, 2019 05:24
Event Log Capture in Windows using GoLang
package main
import(
"fmt"
"syscall"
"unsafe"
"log"
"golang.org/x/sys/windows"
)
@fnky
fnky / ANSI.md
Last active May 19, 2024 22:45
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@marklit
marklit / places.sql
Last active May 19, 2024 22:43
Pull H3s for Overture's Places Dataset for May 2024
COPY (
WITH a AS (
SELECT h3_cell_to_parent(h3_string_to_h3(SUBSTR(id, 0, 17)), 2) h3_2,
COUNT(*) num_recs
FROM read_parquet('s3://overturemaps-us-west-2/release/2024-05-16-beta.0/theme=places/type=place/*.parquet',
filename=true,
hive_partitioning=1)
GROUP BY 1
)
SELECT h3_cell_to_boundary_wkt(h3_2),
@olliencc
olliencc / WindowsVEHusingProcEnumandCountandDecode.cpp
Created January 3, 2022 14:01
Enumerates processes which use VEH via their PEB and then counts the number of VEHs present - decodes pointers and works out which module they are in
/*
VEH misuse detector for Microsoft Windows
Released as open source by NCC Group Plc - http://www.nccgroup.com/
Developed by Ollie Whitehouse, ollie dot whitehouse at nccgroup dot com
Released under AGPL see LICENSE for more information
*/