Skip to content

Instantly share code, notes, and snippets.

@Manouchehri
Manouchehri / centos8-chroot.sh
Created March 15, 2022 15:43 — forked from snixon/centos8-chroot.sh
Build a centos8 AWS AMI in a chroot
#!/bin/bash -ex
# Build a new Centos8 install on EBS volume in a chroot
# Run from RHEL8 or CentOS8 instance - eg: ami-0c322300a1dd5dc79 in us-east-1 (RHEL 8 official image)
# Script expects a second EBS volume, I add them as /dev/sdf in the console
# When the script completes, turn the second EBS volume into your new AMI through the console.
# Adjust the section below to match the device names you're using. Defaults are for an m5.large
# m5 series requires the updated device names
@Manouchehri
Manouchehri / sh.sh
Created November 15, 2021 17:30 — forked from scottopell/sh.sh
Embed SRT file into mp4 with ffmpeg
# got this from http://stackoverflow.com/questions/8672809/use-ffmpeg-to-add-text-subtitles
ffmpeg -i infile.mp4 -f srt -i infile.srt -c:v copy -c:a copy -c:s mov_text outfile.mp4
# confirmed working with the following ffmpeg
# (installed using `brew 'ffmpeg', args: ['with-libvorbis', 'with-libvpx']` )
ffmpeg version 3.1.2 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 7.3.0 (clang-703.0.31)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.1.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-libvorbis --enable-libvpx --disable-lzma --enable-vda
@Manouchehri
Manouchehri / isolate.sh
Created September 18, 2021 22:43 — forked from cynecx/isolate.sh
wireguard & netns (crappy)
#!/usr/bin/env bash
set -e -o pipefail
shopt -s extglob
export LC_ALL=C
CONTAINER=""
INTER_GATEWAY="192.168.30.0/24"
INTER_IP_HOST="192.168.30.1/32"
INTER_IP_CONT="192.168.30.2/32"
From a4a400549761cba03af4a6a14caeb3785255a1e3 Mon Sep 17 00:00:00 2001
From: Joey Jiao <joeyjiaojg@163.com>
Date: Sun, 27 Oct 2019 13:39:43 +0800
Subject: [PATCH] AFL: Enable AFL by global paths
Change-Id: Iede00c60802f7b4856cde6d3b3c27201a68f3e5f
---
android/config.go | 21 +++++++++++++++++++++
android/variable.go | 4 ++++
cc/builder.go | 11 +++++++++++
@Manouchehri
Manouchehri / 1.js
Created April 21, 2021 21:07 — forked from getify/1.js
demonstrating how to use "nodegit" to modify and read from a local bare git repo
/*
NOTE: This code assumes a bare git repo in ./bare-git/,
which should have at least one text file in its root,
named "greetings.txt".
This code updates the contents of a "greetings.txt"
file, and creates a new file called "greetings-XXX.txt"
(with XXX being a random number). It then creates a new
commit for these changes. Finally, it reads and dumps
the new current contents of the repo, file by file.
@Manouchehri
Manouchehri / 0-enp2s0.network
Created February 12, 2021 22:39 — forked from cloudnull/0-enp2s0.network
Compute node systemd-networkd setup with bonding
[Match]
Name = enp2s0
[Network]
Address = 172.16.25.52/22
@Manouchehri
Manouchehri / zram-ubuntu-1804.md
Created December 6, 2020 19:12 — forked from rizalp/zram-ubuntu-1804.md
Zram Ubuntu 1804
  • sudo apt install zram-config, this will install several files, including systemd startup /etc/systemd/system/multi-user.target.wants/zram-config.service
  • sudo nano /usr/bin/init-zram-swapping and edit:
#!/bin/sh

# load dependency modules
NRDEVICES=1
if modinfo zram | grep -q ' zram_num_devices:' 2>/dev/null; then
 MODPROBE_ARGS="zram_num_devices=${NRDEVICES}"
@Manouchehri
Manouchehri / gist:d7b72f7162665874d7fb8e9dc25923ff
Created February 21, 2020 17:42 — forked from 9thplayer/gist:df042fe48c314dbc1afad80ffed8387d
Hitron Router - CODA - 4582U - 7.1.1.30 - Stored XSS Vulnerability
Hitron CODA-4582U 7.1.1.30 devices allow XSS via a Managed Device name on the > Wireless > Access Control > Add Managed Device screen.
Impact:
Script can be stored in Database and execute every time when users visits it. If an attacker can control a script that is executed in the victim's browser, then they can typically fully compromise that user.
Amongst other things, the attacker can:
1) Perform any action within the application that the user can perform.
2) View any information that the user is able to view.
3) Modify any information that the user is able to modify.
4) Initiate interactions with other application users, including malicious attacks, that will appear to originate from the initial victim user.
@Manouchehri
Manouchehri / CF-U1-BIOS.md
Created January 31, 2020 22:07 — forked from en4rab/CF-U1-BIOS.md
Recovering the BIOS password from a Panasonic CF-U1 mk2 (AMI Aptio UEFI)

Recovering the BIOS password from a Panasonic CF-U1 mk2 (AMI Aptio UEFI)

A mess of my own making

While messing with a CF-U1 handheld PC that I bought off ebay I managed to mess up the BIOS and it seems it reverted to previous settings which included an unknown BIOS password, it would however still boot into windows. Since I could still boot windows I was able to dump the bios flash using AFUWINGUI.EXE the version I used was 3.09.03.1462 which is available here:
https://ami.com/en/?Aptio_4_AMI_Firmware_Update_Utility.zip

#include <android/log.h>
#include <jni.h>
#include <binder/Binder.h>
#include <binder/Parcel.h>
#include <binder/IServiceManager.h>
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>