Skip to content

Instantly share code, notes, and snippets.

@vietlq
vietlq / mmap-fork.c
Created April 22, 2017 21:17 — forked from kashyapp/mmap-fork.c
sample code to test out fork and mmap of shared memory
#include <time.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <stdlib.h>
#include <sys/stat.h> /* For mode constants */
#include <fcntl.h> /* For O_* constants */
@vietlq
vietlq / README.md
Last active March 10, 2022 05:05
Hugo Partial Template to render Open Graph & Twitter Card meta tags
@vietlq
vietlq / README.md
Last active May 1, 2017 17:18
PySmile Transparency Preservation: Implementation Details
@vietlq
vietlq / rm.js
Created May 2, 2017 21:53
recursive directory delete with promises (using rsvp) in node.js
var rsvp = require("rsvp")
var Promise = rsvp.Promise;
function cleardir(path) {
return new Promise(function(resolve, reject) {
fs.readdir(path, function(err, dir) {
if (err) {
reject(err);
return;
}

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.

SECURITY BULLETIN AND UPDATES HERE: https://technet.microsoft.com/en-us/library/security/ms17-010.aspx

@vietlq
vietlq / .bash_profile
Last active July 3, 2017 05:50 — forked from molivier/gist:271bba5d67de1583a8e3
Set $GOPATH on Mac OSX : bash_profile
# Edit ~/.bash_profile
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$PATH
# Reload profile : source ~/.bash_profile
@vietlq
vietlq / 000_README.md
Last active August 8, 2017 08:00
Floats and Doubles for Dummies: Understanding Floating Points
@vietlq
vietlq / 010_simple_near_equal.cpp
Last active August 10, 2017 08:01
Floats and Doubles for Dummies: Understanding Floating Points
#include <cmath>
#include <iostream>
template<typename FP>
bool nearEqual(FP v1, FP v2, FP absTol)
{
return std::abs(v1 - v2) <= absTol;
}
template<typename FP>
@vietlq
vietlq / arduinoclock.cpp
Created August 23, 2017 18:51 — forked from Bravo555/arduinoclock.cpp
Arduino clock project
#include <Wire.h>
#include <TimeLib.h>
#include <DS1307RTC.h>
#include <LiquidCrystal_I2C.h>
int budzikGodzina = 7, budzikMinuta = 0;
LiquidCrystal_I2C lcd(0x27, 16, 2);
tmElements_t tm;
@vietlq
vietlq / arduinoclock.cpp
Created August 23, 2017 18:51 — forked from Bravo555/arduinoclock.cpp
Arduino clock project
#include <Wire.h>
#include <TimeLib.h>
#include <DS1307RTC.h>
#include <LiquidCrystal_I2C.h>
int budzikGodzina = 7, budzikMinuta = 0;
LiquidCrystal_I2C lcd(0x27, 16, 2);
tmElements_t tm;