Skip to content

Instantly share code, notes, and snippets.

View peterkodermac's full-sized avatar

Peter Kodermac peterkodermac

View GitHub Profile
@spryffee
spryffee / recover-admin-password-windows10
Last active January 19, 2022 09:37
recover admin password windows 10
# Boot from Windows 10 Installation ISO https://www.microsoft.com/en-au/software-download/windows10
Shift+F10 # open a DOS command prompt window
# Create a Secondary (Local) Administrator User
# Note: it may fail if system disk is not D:, then type "Dir E:", "Dir F:" etc until you find which drive is system
Move D:\Windows\System32\utilman.exe D:\Windows\System32\utilman.bak
Copy D:\Windows\System32\cmd.exe D:\Windows\System32\utilman.exe
wpeutil reboot
# allow Windows to boot up normally, not from ISO
# bring up a command prompt at the login screen by clicking the "Ease of Access" option on the Windows 10 login screen.
@mscalora
mscalora / letsencrypt-update-lighttpd
Last active January 18, 2024 00:28
script to auto update letsencrypt certs for debian lighttpd installation (based on script by Danny Tuppeny)
#!/usr/bin/env bash
#
# Update letsencrypt on a lighttp installation
#
# if you installed letsencrypt in a non-standard location you
# can set the LEDIR env var before you run this script
#
# setup letsencrypt install directory
STDLEDIR=/opt/letsencrypt
@bvanskiver
bvanskiver / shrew-soft-shortcut.bat
Last active March 14, 2023 07:25
Shrew Soft VPN client shortcut with saved credentials
rem http://www.shrew.net/
"C:\Program Files\ShrewSoft\VPN Client\ipsecc.exe" -r "VPN Profile Name" -u "Username" -p "Password" -a
@jamescmartinez
jamescmartinez / slack_delete.rb
Last active May 28, 2024 15:00
This Ruby script will bulk remove all Slack files older than 30 days. Just add your API token from https://api.slack.com/web#authentication into the token quotes at the top of the file.
require 'net/http'
require 'json'
require 'uri'
@token = ''
def list_files
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago
params = {
token: @token,
@arthurleon
arthurleon / unique-val-col-calc
Created June 25, 2015 14:44
Get unique values of a column in Libre Office Calc
Select the whole column
Data > Filter > Standard Filter
Change 'Field Name' to -none- , click on 'More options' and check on 'No duplication' box
Source: http://superuser.com/questions/238656/openoffice-get-distinct-values-from-column
@tshrkmd
tshrkmd / styles_noactionbar.xml
Last active November 3, 2022 09:58
Theme.AppCompat.Light.NoActionBar
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.AppCompat.Light.NoActionBar" parent="@style/Theme.AppCompat.Light">
<item name="android:windowNoTitle">true</item>
<item name="windowActionBar">false</item> <!-- For 2.x version -->
</style>
</resources>
@chuckreynolds
chuckreynolds / wordpress-change-domain-migration.sql
Last active February 10, 2023 18:56
UPDATE: Use WP-CLI find-replace command to edit URLs in your database. https://developer.wordpress.org/cli/commands/search-replace/ Use this SQL script when changing domains on a WordPress site. Whether you’re moving from an old domain to a new domain or you’re changing from a development domain to a production domain this will work. __STEP1: al…
/* Use WP-CLI instead https://developer.wordpress.org/cli/commands/search-replace/ */
SET @oldsite='http://oldsite.com';
SET @newsite='http://newsite.com';
UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite);
UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite);
UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite, @newsite);
/* only uncomment next line if you want all your current posts to post to RSS again as new */