Skip to content

Instantly share code, notes, and snippets.

View cmbaughman's full-sized avatar
🧐
I may be slow to respond.

Chris Baughman cmbaughman

🧐
I may be slow to respond.
View GitHub Profile
@cmbaughman
cmbaughman / win_network_linux.md
Created November 8, 2023 14:17
Notes on Ubuntu as a replacement for Windows AD DC server

Ubuntu as a replacement for Windows Network server

Set up an Ubuntu Server as a standalone Windows network server. In this scenario, we'll assume that you want to replace an existing Windows domain server with the Ubuntu server. Here are the steps:

  1. Install Ubuntu Server:

    • Start by downloading the Ubuntu Server ISO image from the official Ubuntu website.
    • Create a bootable USB drive or mount the ISO on your server.
    • Follow the installation prompts to install Ubuntu Server. During installation, choose the appropriate options for language, keyboard layout, and network configuration.
  2. Configure Network Settings:

@cmbaughman
cmbaughman / mysql_replication.md
Created November 8, 2023 13:41
Setting Up MySQL Replication

Setting Up MySQL Replication

Overview

We’ll configure one MySQL instance as the source database and another as its replica. Replication allows data synchronization between these separate databases.

Step 1: Configure the source

  1. Obviously install MySQL on 2 servers.
@cmbaughman
cmbaughman / SHOW_IP.vbs
Created November 7, 2016 17:44
Simple Show IP Address for Windows Script Host
dim NIC1, Nic, StrIP, CompName
Set NIC1 = GetObject("winmgmts:").InstancesOf("Win32_NetworkAdapterConfiguration")
For Each Nic in NIC1
if Nic.IPEnabled then
StrIP = Nic.IPAddress(i)
@cmbaughman
cmbaughman / gitconf.md
Last active August 3, 2023 15:34
Git Keep Line feeds even on Windows

Git Keep Line feeds even on Windows

  • Make sure Windows leaves your line endings alone. This way you can still run shell scripts and things in Git Bash or WSL: git config --global core.autocrlf input

  • Next, after committing any changes you do not have staged, run these:

git rm --cached -r .
git reset --hard
const SpotifyWebApi = require('spotify-web-api');
const fs = require('fs');
const os = require('os');
const readline = require('readline');
const spotify = new SpotifyWebApi({
clientId: 'YOUR_CLIENT_ID',
clientSecret: 'YOUR_CLIENT_SECRET',
redirectUri: 'http://localhost:3000',
});
@cmbaughman
cmbaughman / wordpress_encryption_fragment.php
Created May 7, 2015 13:17
Functions to decrypt and encrypt Wordpress passwords from plugin.
<?php
/* These need to go in your custom plugin (or existing plugin) */
private function encrypt($input_string, $key){
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$h_key = hash('sha256', $key, TRUE);
return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $h_key, $input_string, MCRYPT_MODE_ECB, $iv));
}
@cmbaughman
cmbaughman / Reaper.bat
Last active April 20, 2023 14:20
Quick untested bat script to run reaper as admin
@echo off
set local
set runas=runas /user:Administrator
%runas% "c:\program files\reaper.exe"
%runas% explorer.exe
@cmbaughman
cmbaughman / firefox-dev-linux.md
Created October 12, 2020 14:14
Install Firefox Developer Edition On Linux

Installing the latest Firefox Developer Edition on Linux

Prerequisites

You need to have the application curl installed. Most Linux distros will already have it included. However, you may need to run either:

Fedora/RedHat

$ sudo dnf -y install curl
@cmbaughman
cmbaughman / how_to_irc.md
Last active March 3, 2023 21:48
IRC How To AnonOps

Introduction

Now onto actually using IRC. A lot of this stuff is just extra info. You don't need to know it. We don't need to know it. We just love typing out this crap. You are smart, you already know all this. No need to read it. OK now that was sarcasm. IRC is full of it so get used to it. You really do need to know this stuff. If you thought it was rude of me to be sarcastic, you wont survive on IRC very long.

Getting started

First up, pick a nick. A nickname, commonly referred to as 'nick', is your IRC name. Yours will appear before all of your messages in IRC to identify who is talking. If another user types your nick, the text is printed in red. This is a highlight. Some clients also will flash the window, send a beep, etc. You can select almost any nickname you like, provided nobody else uses it. If you choose a nick like 'justinbieber' or 'Ims0l33t4ndc00l', prepare to be ridiculed. Seriously. The [ ] in the command indicate where to place your own choices. Do not include the [ ] themselves.

@cmbaughman
cmbaughman / NewGoogleDorks.md
Last active February 27, 2023 22:07
New Google Dorks for open directories.

Open Directories


Ebooks examples

Paste this in the search box or use the URL that follows:

+(.MOBI|.CBZ|.CBR|.CBC|.CHM|.EPUB|.FB2|.LIT|.LRF|.ODT|.PDF|.PRC|.PDB|.PML|.RB|.RTF|.TCR) PUT EBOOK NAME HERE intitle:"index of" -inurl:(jsp|pl|php|html|aspx|htm|cf|shtml) -inurl:(listen77|mp3raid|mp3toss|mp3drug|index_of|wallywashis)