Skip to content

Instantly share code, notes, and snippets.

View beppe9000's full-sized avatar

beppe9000

View GitHub Profile
@beppe9000
beppe9000 / choco.bat
Created February 12, 2022 15:31 — forked from avenet/choco.bat
Installs Chocolatey and my preferred Windows programs
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
choco install Atom
choco install notepadplusplus.install
choco install 7zip
choco install flashplayerplugin
choco install vlc
choco install nodejs
choco install vcredist2010
choco install PowerShell
@echo off
:: http://weblogs.asp.net/jgalloway/archive/2006/11/20/top-10-dos-batch-tips-yes-dos-batch.aspx
echo %%~1 = %~1
echo %%~f1 = %~f1
echo %%~d1 = %~d1
echo %%~p1 = %~p1
echo %%~n1 = %~n1
echo %%~x1 = %~x1
echo %%~s1 = %~s1
echo %%~a1 = %~a1
@beppe9000
beppe9000 / private_fork.md
Created January 31, 2022 10:09 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@beppe9000
beppe9000 / whitelist.py
Last active January 22, 2022 15:42 — forked from 0x9900/whitelist.py
Extract the IP addresses from SPF records.
#!/usr/bin/env python
# Purpose: Print the list of ip addresses from SPF records
# Author: beppe9000
import dns
from dns import resolver
from collections import defaultdict
import re
import sys
@beppe9000
beppe9000 / DllInjector.cs
Created April 28, 2021 11:29 — forked from ultratrunks/DllInjector.cs
Clean class in C# used for DLL injection
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace DllInjector
{
public static class DllInjector
{
@beppe9000
beppe9000 / ghetto.md
Last active November 20, 2020 21:31 — forked from dusta/Deploy_on_cPanel.md
Ghetto Deployment

Deploy your site with git on cPanel

The most important: You must have shell access!

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
  • your (PHP) scripts are served from /var/www/html/
@beppe9000
beppe9000 / LICENSE.txt
Created August 19, 2020 12:25 — forked from azproduction/LICENSE.txt
A turing machine in 79! bytes of javascript
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@beppe9000
beppe9000 / JunctionPoint.cs
Last active April 10, 2020 00:49 — forked from LGM-AdrianHum/JunctionPoint.cs
Create, Delete and Examine Junction Points in C#
// File: RollThroughLibrary/CreateMaps/JunctionPoint.cs
// User: Adrian Hum/
//
// Created: 2017-11-19 2:46 PM
// Modified: 2017-11-19 6:10 PM
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Runtime.InteropServices;
@beppe9000
beppe9000 / my.cnf
Created January 22, 2020 14:08 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
# Optimized my.cnf configuration for MySQL/MariaSQL
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated January 2020 ~
#
#
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@beppe9000
beppe9000 / dumprequest.php
Last active January 27, 2021 12:23 — forked from magnetikonline/dumprequest.php
PHP script to dump full HTTP request to file (method, HTTP headers and body).
// usage: logRequest("/tmp/post-".time().".log");
function logRequest($targetFile){ $headerList = []; foreach ($_SERVER as $name => $value) { if (preg_match('/^HTTP_/',$name)) { // convert HTTP_HEADER_NAME to Header-Name $name = strtr(substr($name,5),'_',' '); $name = ucwords(strtolower($name)); $name = strtr($name,' ','-'); $headerList[$name] = $value; } } $data = sprintf("%s %s %s\n", $_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI'], $_SERVER['SERVER_PROTOCOL']); foreach ($headerList as $name => $value) { $data .= $name.': '.$value."\n"; } $data .= "\n"; file_put_contents($targetFile, $data.file_get_contents('php://input')."\n"); }