Skip to content

Instantly share code, notes, and snippets.

View AdamBouhmad's full-sized avatar
🐢

Adam Bouhmad AdamBouhmad

🐢
View GitHub Profile
@niutech
niutech / hosts
Last active May 15, 2024 15:21
/etc/hosts file for blocking Microsoft Edge tracking domains (and more)
0.0.0.0 a-0001.a-msedge.net
0.0.0.0 a-0002.a-msedge.net
0.0.0.0 a-0003.a-msedge.net
0.0.0.0 a-0004.a-msedge.net
0.0.0.0 a-0005.a-msedge.net
0.0.0.0 a-0006.a-msedge.net
0.0.0.0 a-0007.a-msedge.net
0.0.0.0 a-0008.a-msedge.net
0.0.0.0 a-0009.a-msedge.net
0.0.0.0 a-msedge.net
@detroitenglish
detroitenglish / zxcvbn-haveibeenpwned-pw-check.js
Last active January 10, 2020 00:04
Fastify Handler: Password Scoring with zxcvbn + haveibeenpwned Range Query API
import zxcvbn from 'zxcvbn'
import axios from 'axios'
import crypto from 'crypto'
// Input is first validated via native Fastify JSON-schema declaration
export async function passwordStrengthChecker(req, reply) {
const { password } = req.body
let message, pwned, ok
let { score } = zxcvbn(password)
try {
118.116.127.196|2018-03-22
62.28.56.161|2018-03-22
185.109.161.38|2018-03-22
185.109.161.38|2018-03-21
62.28.56.161|2018-03-21
5.188.11.89|2018-03-21
77.72.82.22|2018-03-21
91.217.9.163|2018-03-20
5.188.11.89|2018-03-20
5.188.11.89|2018-03-19

Meltdown fix impact on Redis performances in virtualized environments

UPDATE: apparently kernel difference may have a serious impact, so I'll redo the test from scratch.

Test performed with AOF enabled, fsync policy 1 second, allowing the rewrites to be triggered.

Command lines used:

#!/usr/bin/env python3
# Gambling Statistics Problem:
# If you play roulette every day and quit whenever you're ahead by x amount,
# do you make money in the long run?
# Answer:
# No.
import random
STARTING_BALANCE = 100000
@darvid
darvid / requirements.txt
Last active August 29, 2017 17:29 — forked from jarpy/requirements.txt
Serverless Elasticsearch Curator for AWS Lambda
boto3>=1.4.6,<2.0.0
certifi>=2017.7.27.1,<2018.0.0.0
elasticsearch-curator>=5.1.2,<6.0.0
PyYAML>=3.12,<4.0
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active May 15, 2024 22:27
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@thumphries
thumphries / client.hs
Last active May 11, 2018 04:17
Example of a redirect vulnerability
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
import Control.Applicative
import Control.Lens
import Control.Monad
import Data.ByteString (ByteString)
import qualified Data.ByteString.Lazy as BSL
import qualified Data.IORef as IORef
@worawit
worawit / eternalblue8_exploit.py
Last active March 16, 2024 18:38
Eternalblue exploit for Windows 8/2012
#!/usr/bin/python
# This file has no update anymore. Please see https://github.com/worawit/MS17-010
from impacket import smb, ntlm
from struct import pack
import sys
import socket
'''
EternalBlue exploit for Windows 8 and 2012 by sleepya
The exploit might FAIL and CRASH a target system (depended on what is overwritten)

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