Skip to content

Instantly share code, notes, and snippets.

@Chenx221
Chenx221 / recovery.json, cloudready_recovery.json
Last active April 11, 2025 08:15
Chrome OS recovery images manual download (Flex)
# Chrome OS recovery images manual download
https://dl.google.com/dl/edgedl/chromeos/recovery/recovery2.json
https://dl.google.com/dl/edgedl/chromeos/recovery/recovery.json
# Google Chrome OS Flex images manual download
https://dl.google.com/dl/edgedl/chromeos/recovery/cloudready_recovery2.json
https://dl.google.com/dl/edgedl/chromeos/recovery/cloudready_recovery.json
@bhandarisaurav
bhandarisaurav / Online KMS Activator.cmd
Last active October 4, 2024 15:29
Activate Windows & Office for 180 Days with online KMS Servers. This script does not install any files in your system and it clears all the leftovers including kms server name after the Activation. For Successful Activation, Internet Must be connected.
@echo off
::::::::::::::::::::::::::::
set "params=Problem_with_elevating_UAC_for_Administrator_Privileges"&if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs"
fsutil dirty query %systemdrive% >nul 2>&1 && goto :GotPrivileges
:: The following test is to avoid infinite looping if elevating UAC for Administrator Privileges failed
If "%1"=="%params%" (echo Elevating UAC for Administrator Privileges failed&echo Right click on the script and select 'Run as administrator'&echo Press any key to exit...&pause>nul 2>&1&exit)
cmd /u /c echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "%~0", "%params%", "", "runas", 1 > "%temp%\getadmin.vbs"&cscript //nologo "%temp%\getadmin.vbs"&exit
:GotPrivileges
::::::::::::::::::::::::::::
color 1F
@settachok
settachok / Config.json
Last active February 1, 2021 13:45
Cloudflare API Dynamic DNS Update in PowerShell
{
"auth_email": "[email protected]",
"auth_key": "cloudflare auth_key",
"zone_name": "example.com",
"records": [
"example.com",
"www.example.com"
]
}
@jbratu
jbratu / setupiisforsslperfectforwardsecrecy_v17.ps1
Last active January 17, 2025 10:17
Great powershell script for tightening HTTPS security on IIS and disabling insecure protocols and ciphers. Very useful on core installations.
# Copyright 2019, Alexander Hass
# https://www.hass.de/content/setup-microsoft-windows-or-iis-ssl-perfect-forward-secrecy-and-tls-12
#
# After running this script the computer only supports:
# - TLS 1.2
#
# Version 3.0.1, see CHANGELOG.txt for changes.
Write-Host 'Configuring IIS with SSL/TLS Deployment Best Practices...'
Write-Host '--------------------------------------------------------------------------------'
@EntilZha
EntilZha / hashtable.py
Last active December 18, 2022 05:37
Hash Table (Open Address) implementation in Python practicing for interviews
from collections import namedtuple
TableEntry = namedtuple('Element', 'hash key value')
class HashTable(object):
DEFAULT_SIZE = 8
EMPTY_VALUE = TableEntry(None, None, None)
DELETED_VALUE = TableEntry(None, None, None)
LOAD_FACTOR = 2 / 3
MIN_FACTOR = 1 / 3
@mreid
mreid / huffman.py
Last active September 25, 2021 12:22
Example implementation of Huffman coding in Python
# Example Huffman coding implementation
# Distributions are represented as dictionaries of { 'symbol': probability }
# Codes are dictionaries too: { 'symbol': 'codeword' }
def huffman(p):
'''Return a Huffman code for an ensemble with distribution p.'''
assert(sum(p.values()) == 1.0) # Ensure probabilities sum to 1
# Base case of only two symbols, assign 0 or 1 arbitrarily
if(len(p) == 2):
@kracekumar
kracekumar / hashmap.py
Last active November 25, 2021 08:05
Hash Map implementation in Python
### Hash implementation in python
def custom_hash(key):
"""
Return the hash value of the given key. Uses dbj2
@param key: String or unicode
"""
result = 5381
multiplier = 33
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten