Skip to content

Instantly share code, notes, and snippets.

hscale / service-worker.js
Created December 19, 2019 16:52 — forked from arikanmstf/service-worker.js
Service Worker Example
View service-worker.js
self.addEventListener('push', function (event) {
if (event && {
const data =;
event.waitUntil(self.registration.showNotification(data.title, {
body: data.body,
icon: data.icon || null
hscale / sed cheatsheet
Created April 7, 2019 07:43 — forked from someguynamedmatt/sed cheatsheet
magic of sed -- find and replace "text" in a string or a file
View sed cheatsheet
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
hscale /
Created November 19, 2018 10:13 — forked from ashutoshsmaurya/
Backup Web Server and Database to Google Drive - Bash Script
#Please note - This script tested on Centos-6,7/Redhat-6,7.
#Check Internet Connection
IS=`/bin/ping -c 5 | grep -c "64 bytes"`
if (test "$IS" -gt "2") then
#Check Gdrive Software Install Or Not
if [ -f "$file" ]
hscale / repeatable-fields-metabox.php
Created July 18, 2017 03:48 — forked from helen/repeatable-fields-metabox.php
Repeating Custom Fields in a Metabox
View repeatable-fields-metabox.php
* Repeatable Custom Fields in a Metabox
* Author: Helen Hou-Sandi
* From a bespoke system, so currently not modular - will fix soon
* Note that this particular metadata is saved as one multidimensional array (serialized)
function hhs_get_sample_options() {

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 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).


hscale /
Created March 13, 2017 02:17 — forked from granoeste/
[Android] Button background change for state. (selector)
package com.example.sellectorsample;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
public class MainActivity extends Activity implements OnClickListener {
View udemy-promocode-022017
hscale / worker nginx conf
Created January 12, 2017 21:39 — forked from fqrouter/worker nginx conf
Youtube Reverse Proxy
View worker nginx conf
location /video/ {
if ($request_uri ~ "^/video/(.+?)/.+") {
set $upstream_host $;
add_header Content-Disposition "attachment; filename=video.mp4;";
rewrite /video/.+?/(.+)$ /$1 break;
proxy_buffering off;
proxy_pass https://$upstream_host;
proxy_set_header Host $upstream_host;
hscale /
Created September 19, 2016 13:15 — forked from quangnh89/
A malware analysis case-study: Deobfuscate Windows malicious obfuscated code
# Slide :
import sys
import pefile
from capstone import *
from capstone.x86 import *
from keystone import *
from datetime import datetime
MAX_DISASM_COUNT = 1000 * 1000
FILE_NAME = r"dump-g4pic.dll"