Skip to content

Instantly share code, notes, and snippets.

@msuiche
msuiche / WipeMeOrNot.c
Created June 29, 2017 06:14
Petya.2017
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
//
// The mysterious command (0x2E214B44) results in the first 10 sectors being wiped out.Or if the original replaceBootSectors() function fails.
//
// 0x2E214B44 ??? => Mysterious process. Name very close to AVP.exe
// Source of below hashes: https://www.carbonblack.com/2017/06/28/carbon-black-threat-research-technical-analysis-petya-notpetya-ransomware/
@Neo23x0
Neo23x0 / wannacry-vaccine.reg
Last active March 15, 2021 19:49
WannaCrypt Ransomware Immunisation
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskdl.exe]
"Debugger"="taskkill /F /IM "
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskse.exe]
"Debugger"="taskkill /F /IM "
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\wannacry.exe]
"Debugger"="taskkill /F /IM "
@vernondcole
vernondcole / restart_your_minion.sls
Last active March 28, 2023 20:43
SaltStack state to restart a minion (using the minion you are restarting)
---
# salt state file for restarting a minion under its own control
{% set delay = salt['config.get']('minion_restart_in_seconds', 5) %}
restart-the-minion:
file.managed:
- name: /tmp/run_command_later.py
- source: salt://run_command_later.py
- mode: 775
@mustafaturan
mustafaturan / network-tweak.md
Last active June 16, 2024 21:58
Linux Network Tweak for 2 million web socket connections

Sample config for 2 million web socket connection

    sysctl -w fs.file-max=12000500
    sysctl -w fs.nr_open=20000500
    # Set the maximum number of open file descriptors
    ulimit -n 20000000

    # Set the memory size for TCP with minimum, default and maximum thresholds 
 sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
@meilinger
meilinger / logstash-filebeat-5-minutes.md
Last active June 26, 2023 12:03
Logstash and Filebeat in 5 minutes

Logstash and Filebeat in 5 minutes

What/Why?

  • Filebeat is a log shipper, capture files and send to Logstash for processing and eventual indexing in Elasticsearch
  • Logstash is a heavy swiss army knife when it comes to log capture/processing
  • Centralized logging, necessarily for deployments with > 1 server
  • Super-easy to get setup, a little trickier to configure
  • Captured data is easy to visualize with Kibana
  • Wny not just Logstash (ELK is so hot right now)?
@ajeetraina
ajeetraina / deploy_swarm_mode.sh
Last active November 2, 2017 02:40
Scripted Installation of M-node Master Node and N-node worker nodes on Apple macOS Sierra
#!/bin/bash
#Script to setup M-node master node and N-node Worker Node running Docker 1.13.1 on Apple Mac Virtualbox
echo "--Setting up Docker Machine---"
curl -L https://github.com/docker/machine/releases/download/v0.13.0/docker-machine-`uname -s`-`uname -m` >/usr/local/bin/docker-machine && \
chmod +x /usr/local/bin/docker-machine
echo "--Verifying Docker Machine Installation--"
docker-machine version
@ajeetraina
ajeetraina / dellome-Dockerfile
Last active March 31, 2017 10:48
Dell OME on Windows 2016 using Docker
SOFTWARE TO INSTALL:
===========================
IIS Server
IIS Roles & Services
ASP.NET Framework & All Features
Microsoft (R) Visual Studio Runtime.
Microsoft SQL Express 2012 SP1 with Essentials specific instance (SQLEXPRESSOME)
IPMI Utility
FROM debian:jessie
ARG VERSION=0.12.1
ARG SHA256HASH=34de171ac1b48b0780d68f3844c9fd2e8bfe6a7780b55e1f012067c2440ebd8a
RUN apt-get update && \
apt-get install -y wget ca-certificates && \
apt-get clean && \
wget https://www.bitcoinunlimited.info/downloads/bitcoinUnlimited-${VERSION}-linux64.tar.gz && \
@broxio
broxio / gist:4a7517834399656ee6871c278e343e32
Created June 4, 2016 07:46
Update gitlab omnibus package and can use git due to MOTD
/etc/pam.d/sshd
#Comment out pam_motd.so to disable MOTD
#session optional pam_motd.so motd=/run/motd.dynamic noupdate
#session optional pam_motd.so # [1]