Skip to content

Instantly share code, notes, and snippets.

View sheeit's full-sized avatar
💭
I may be slow to respond.

wmb sheeit

💭
I may be slow to respond.
View GitHub Profile
@grfiv
grfiv / convert_mysql_to_sqlite3.sh
Created September 4, 2016 19:29
convert a mysql database to sqlite3
#!/bin/bash
#
# convert a mysql database to sqlite3
#
#see https://stackoverflow.com/questions/5164033/
# export-a-mysql-database-to-sqlite-database
mysql_host=localhost
mysql_user=george
#mysql_passwd=****************
@HaleTom
HaleTom / print256colours.sh
Last active November 6, 2025 21:56
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256
@sheeit
sheeit / euler.c
Last active August 29, 2022 21:22 — forked from anonymous/euler1.c
Euler Project (in C)
/*
Copyright 2016 strupo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of

WannaCry|WannaDecrypt0r NSA-Cyberweapon-Powered Ransomware Worm

  • Virus Name: WannaCrypt, WannaCry, WanaCrypt0r, WCrypt, WCRY
  • Vector: All Windows versions before Windows 10 are vulnerable if not patched for MS-17-010. It uses EternalBlue MS17-010 to propagate.
  • Ransom: between $300 to $600. There is code to 'rm' (delete) files in the virus. Seems to reset if the virus crashes.
  • Backdooring: The worm loops through every RDP session on a system to run the ransomware as that user. It also installs the DOUBLEPULSAR backdoor. It corrupts shadow volumes to make recovery harder. (source: malwarebytes)
  • Kill switch: If the website www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com is up the virus exits instead of infecting the host. (source: malwarebytes). This domain has been sinkholed, stopping the spread of the worm. Will not work if proxied (source).

update: A minor variant of the viru

@WayOfTheQway
WayOfTheQway / main.c
Last active July 25, 2017 19:52
Given n points within the unit square, calculate the smallest circle that lies completely within the unit square and contains exactly half of the given points.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define PRECISION "10"
typedef struct __point point;
typedef struct __circle circle;
struct __point
@Cheezmeister
Cheezmeister / aoc.pl.md
Last active November 7, 2018 01:25
AoC 2017
anonymous
anonymous / restore-old-reddit-favicon.user.js
Created December 14, 2017 15:24
Tampermonkey/Greasemonkey script that restores the old blue Reddit favicon
// ==UserScript==
// @name Restore Old Blue Reddit Favicon
// @namespace http://tampermonkey.net/
// @version 0.1.0
// @description Restores the old blue Reddit favicon
// @icon http://www.reddit.com/favicon.ico
// @icon64 http://www.reddit.com/favicon.ico
// @include /^https?:\/\/(.+\.)?reddit\.com\/?.*$/
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
// @grant none
// ==UserScript==
// @name EmuParadise Download Workaround - 1.1.1
// @version 1.1.2
// @description Replaces the download button link with a working one
// @author Eptun
// @match https://www.emuparadise.me/*/*/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @grant none
// ==/UserScript==
@fay59
fay59 / Quirks of C.md
Last active November 3, 2025 03:10
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active October 28, 2025 06:41
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}