Skip to content

Instantly share code, notes, and snippets.

@hscale
hscale / service-worker.js
Created Dec 19, 2019 — forked from arikanmstf/service-worker.js
Service Worker Example
View service-worker.js
self.addEventListener('push', function (event) {
if (event && event.data) {
const data = event.data.json();
event.waitUntil(self.registration.showNotification(data.title, {
body: data.body,
icon: data.icon || null
});
}
});
@hscale
hscale / sed cheatsheet
Created Apr 7, 2019 — forked from someguynamedmatt/sed cheatsheet
magic of sed -- find and replace "text" in a string or a file
View sed cheatsheet
FILE SPACING:
# 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
hscale / Basckup_Web_Database_Server.sh
Created Nov 19, 2018 — forked from ashutoshsmaurya/Basckup_Web_Database_Server.sh
Backup Web Server and Database to Google Drive - Bash Script
View Basckup_Web_Database_Server.sh
#!/bin/bash
#Please note - This script tested on Centos-6,7/Redhat-6,7.
#Check Internet Connection
IS=`/bin/ping -c 5 4.2.2.2 | grep -c "64 bytes"`
if (test "$IS" -gt "2") then
internet_conn="1"
#Check Gdrive Software Install Or Not
file="/usr/bin/gdrive"
if [ -f "$file" ]
then
@hscale
hscale / repeatable-fields-metabox.php
Created Jul 18, 2017 — 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() {
View Wannacrypt0r-FACTSHEET.md

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

SECURITY BULLETIN AND UPDATES HERE: h

@hscale
hscale / MainActivity.java
Created Mar 13, 2017 — forked from granoeste/MainActivity.java
[Android] Button background change for state. (selector)
View MainActivity.java
package com.example.sellectorsample;
import android.app.Activity;
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
https://www.udemy.com/static/upgrade-your-browser/
https://www.udemy.com/the-complete-aliexpress-dropshipping-course/?awc=6554_1486679118_7a7a46be4e9a5b123dfafe81b6774cc7&utm_source=Growth-Affiliate&utm_medium=Affiliate-Window&utm_campaign=Campaign-Name&utm_term=211845&utm_content=Placement
https://www.udemy.com/introduction-to-computer-hardware-components/?awc=6554_1486679118_c9d708b3766666269774b8b534f35aad&utm_source=Growth-Affiliate&utm_medium=Affiliate-Window&utm_campaign=Campaign-Name&utm_term=211845&utm_content=Placement
https://www.udemy.com/the-immortal-classical-chinese-poetry-season-1/learn/v4/?utm_content=Placement&utm_term=211845&utm_source=Growth-Affiliate&couponCode=UDEMYSTUDIOREVIEW&utm_campaign=Campaign-Name&awc=6554_1486679119_370a36caaea0214094c25353a6563355&utm_medium=Affiliate-Window
https://www.udemy.com/chess-strategy-to-win-pawn-endgames/learn/v4/?utm_content=Placement&couponCode=BBH1000&utm_source=Growth-Affiliate&utm_term=211845&utm_campaign=Campaign-Name&utm_medium=Affiliate-Window&
@hscale
hscale / worker nginx conf
Created Jan 12, 2017 — forked from fqrouter/worker nginx conf
Youtube Reverse Proxy
View worker nginx conf
resolver 8.8.8.8;
location /video/ {
if ($request_uri ~ "^/video/(.+?)/.+") {
set $upstream_host $1.googlevideo.com;
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
hscale / deobfuscate.py
Created Sep 19, 2016 — forked from quangnh89/deobfuscate.py
A malware analysis case-study: Deobfuscate Windows malicious obfuscated code
View deobfuscate.py
# Slide : https://docs.google.com/presentation/d/1jLUDucNtvGotHw0LOvDonMYwCkXYcb-cnsOWLNt-Ag0
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"
@hscale
hscale / ALTERNATIVES.adoc
Created May 26, 2016 — forked from mbbx6spp/ALTERNATIVES.adoc
Super quick list of alternatives to Jira and/or Confluence, Stash, Crucible, etc.
View ALTERNATIVES.adoc