Skip to content

Instantly share code, notes, and snippets.

withakay

Block or report user

Report or block withakay

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@withakay
withakay / NTLM.cs
Created Oct 8, 2019
NTLM Hash function in c#
View NTLM.cs
/*
source:
https://www.codeproject.com/Articles/328761/NTLM-Hash-Generator
*/
public static string Ntlm(string key)
{
const uint INIT_A = 0x67452301;
const uint INIT_B = 0xefcdab89;
const uint INIT_C = 0x98badcfe;
View id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDiYWt/bASTO/OR9c6MN4JMjlpTFsbuV+Vn0HfiR/XxRDTH52ay/KdlK0DdbkENVv66cWolZ/J/e71UJwGVTnKwOfYn1Hu4fh3RvLWDPJ/F0eaCvBEmrqxd+KxtWH/0io1J9sSjfAA2zTEGaR6NYf1Kz1lJpYROy7IbfHCpi7UGBbw9DOirPBG8GIH6y5QbZrLvV+CwA+GcQnGy2VU/H8GhQVYFwduhikXerEW9OJeX4USKjea7M1MaW//vPeRb5wQ3rZpJHwLryO0NpkhAU7V6kkaTyPBF95SlP4vE7tI5t/x0Ve/NQ3i4DOkcrQMX56jR4kXLBBF9wSavEcy1vB7tpxL+f/Tpm7IcQ+RwxWAYoNDzFEsU+Fhk5UwKYlTWKEGbSpISFObS72Bp11TgmdJydC5Ns2804DHo/4NlnW4Dg/7Ck0ruxGcCbKNffGPbcBOQRsLMfzcwAIenJoUNoHcchULBeDVcF83X8tobSTx0YDtYFlZKrNlVqHRXt8pZCKLIjAr+Lh1qkad7B1oP0WLokaqMnE0XGR3fzGgPl5kuvKpTLQIA2IbYTg0iW8nGBjq37G7kN/orGyyxcDqr1tWt7jzOwzSJTO4+B84QNyN9CSlSjxKU1sG0NbLdM5mWrAgTlc2EJof9S535oCVNqPlCJ0IT36DhS+6o6aFqMcQzvQ== jack@f4der.local
View doing.js
/* Usage
1. Run the setup function (you'll need to do this twice - 1st time to grant acces to Script Properties)
2. Share > Publish as service ... set security level and enable service
3. Copy the service URL and post this in your form/script action
4. Insert column names on the DATA sheet matching the parameter names of the data you are passing
call via https://your-script-url/exec?key=YOUR_KEY?headerX=123&headerB=xyz
*/
@withakay
withakay / update-authorised-keys.sh
Created Dec 11, 2017
Update authorized keys on remote server using known_hosts
View update-authorised-keys.sh
#!/usr/bin/env bash
# Before running remember to generate a new key and update this script with the name (currently id_rsa_4096.pub)
awk -F'[ ,:]' '/^[0-9a-zA-Z]/{sub(/\[/,"",$1); sub(/\]/,"",$1); print $1}' ~/.ssh/known_hosts | uniq > _hosts
# A script to push a key to the only argument, a remote server.
while read h; do
echo "$h"
@withakay
withakay / README.md
Last active Jul 5, 2018 — forked from ringe/README.md
KVM QCOW2 Live backup
View README.md

Live backup of KVM virtual machines

This script will let you make backups of live VMs running on KVM, using libvirt.

The backup job will suspend the VM for the time it takes to copy the RAM to disk.

Credits: Luca Lazzeroni

Edited to detect and check the image format is qcow2 using qemu-img, rather than rely on the file extension being .qcow2

View clonegroups.sh
#!/usr/bin/env bash
# A quick and dirty script to add one users groups to another
# Tested on Ubuntu 16.04
if [[ -z "$1" || -z "$2" ]]; then
echo "USAGE:"
echo " ./clonegroups.sh <source_user> <dest_user>"
exit 0;
fi
View atom.xml
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Example Feed</title>
<subtitle>Insert witty or insightful remark here</subtitle>
<link href="http://example.org/"></link>
<updated>2003-12-13T18:30:02Z</updated>
<author>
<name>John Doe</name>
<email>johndoe@example.com</email>
View sslfix.ps1
# Copyright 2014, Alexander Hass
# http://www.hass.de/content/setup-your-iis-ssl-perfect-forward-secrecy-and-tls-12
#
# Version 1.4
# - RC4 has been disabled.
# Version 1.3
# - MD5 has been disabled.
# Version 1.2
# - Re-factored code style and output
# Version 1.1 - SSLv3 has been disabled. (Poodle attack protection)
View gist:c6630751a7e27cb6531e
Dropbox command-line interface
commands:
Note: use dropbox help <command> to view usage for a specific command.
status get current status of the dropboxd
throttle set bandwidth limits for Dropbox
help provide help
puburl get public url of a file in your dropbox's public folder
@withakay
withakay / beatport-discog.rb
Last active Aug 29, 2015
Get your discography from beatport
View beatport-discog.rb
#!/usr/bin/env ruby
require "rubygems"
require "json"
require "net/http"
require "uri"
artist = "TR20"
uri = URI.parse("http://www.federicogiust.com/beatportapi/beatport_api.php?facets=performerName:#{artist}&sortBy=publishDate%20desc&perPage=150&url=releases")
You can’t perform that action at this time.