Skip to content

Instantly share code, notes, and snippets.

@Cr4sh
Cr4sh / ami_smi_dump.py
Last active April 25, 2024 14:40
Extract SW SMI handlers information from SMRAM dump of Skylake based AMI Aptio V firmware
'''
###########################################################################
Extract SW SMI handlers information from SMRAM dump of Skylake based
AMI Aptio V firmware.
To use full capabilities of this tool you need to install UEFIDump
(https://github.com/LongSoft/UEFITool/releases/tag/A32), ida-efiutils
(https://github.com/snare/ida-efiutils) and edit corresponding variables
below.
@jlucaspains
jlucaspains / app-gateway-identity.bicep
Last active April 25, 2024 14:40
Bicep to deploy application gateway and its required components for an externally visible Web App
@description('App Service location. Default is the location of the resource group.')
param location string = resourceGroup().location
@description('App base name')
param appBaseName string = 'myapp'
@description('Environment Name.')
param envName string = 'dev'
var applicationGateWayName = 'apgw-${appBaseName}-${envName}-${location}-001'
@mattiasghodsian
mattiasghodsian / readme.md
Last active April 25, 2024 14:39
Valheim Dedicated Server Setup on Ubuntu 20.04.1 LTS

Port forwarding

Open ports (udp)

2456 2457 2458 27060

Uncomplicated Firewall

sudo ufw allow 2456/udp
@jctosta
jctosta / screen_cheatsheet.markdown
Last active April 25, 2024 14:39
Screen Cheatsheet

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@WajihaAd
WajihaAd / gist:c9d117fea0cdb072d959f0875c6ff7d2
Last active April 25, 2024 14:40
C++ game: "Simulate a game where teams randomly generate players and take turns hitting each other, with the final result determined by the number of hits."
#include <iostream>
#include <stdlib.h> // for rand
using namespace std;
class Team {
private:
static int count;
static int count1;
public:
@fransr
fransr / bucket-disclose.sh
Last active April 25, 2024 14:38
Using error messages to decloak an S3 bucket. Uses soap, unicode, post, multipart, streaming and index listing as ways of figure it out. You do need a valid aws-key (never the secret) to properly get the error messages
#!/bin/bash
# Written by Frans Rosén (twitter.com/fransrosen)
_debug="$2" #turn on debug
_timeout="20"
#you need a valid key, since the errors happens after it validates that the key exist. we do not need the secret key, only access key
_aws_key="AKIA..."
H_ACCEPT="accept-language: en-US,en;q=0.9,sv;q=0.8,zh-TW;q=0.7,zh;q=0.6,fi;q=0.5,it;q=0.4,de;q=0.3"
H_AGENT="user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36"
@dhh
dhh / linux-setup.sh
Last active April 25, 2024 14:37
linux-setup.sh
# CLI
sudo apt update -y
sudo apt install -y \
git curl docker.io \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils
@einblicker
einblicker / gist:1324435
Created October 29, 2011 13:19
hurst exponent
import math.{pow, log, sqrt}
import java.util.Random
import org.apache.commons.math.stat.StatUtils.mean
import org.apache.commons.math.stat.regression.SimpleRegression
object HurstExponent extends App {
def hurstExponent(xs: Array[Double]): Double = {
def S(xs: Array[Double]): Double = {
val meanXs = mean(xs)
@johanmeiring
johanmeiring / gist:3002458
Created June 27, 2012 08:32
"git lg" alias for pretty git log
# From http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"