Skip to content

Instantly share code, notes, and snippets.

View jeffbeagley's full-sized avatar

Jeff Beagley jeffbeagley

  • Springfield, MO
View GitHub Profile
{
"team.teamProject": "",
"git.autofetch": true,
"git.enableSmartCommit": true,
"workbench.sideBar.location": "right",
"workbench.startupEditor": "newUntitledFile",
"window.title": "${folderName} - ${dirty}${activeEditorShort}",
"team.showWelcomeMessage": false,
"git.confirmSync": false,
"guides.active.extraIndent": true,
@jeffbeagley
jeffbeagley / gist:72a9335659a40f7b8fc40215e02eda9d
Created March 4, 2022 18:56
Route to specific interface based on CIDR with Ubuntu Route Tables
sudo route add -net <some_destiation_cidr> gw 10.0.2.2 enp0s3
@jeffbeagley
jeffbeagley / gist:c4519009f93c11fcd023228dbe4ac0d8
Created February 28, 2022 23:35
Resize default boot partition on Ubuntu running on ESXI
sudo lvextend -l+100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
sudo growpart /dev/sda 3
sudo pvresize /dev/sda3
sudo lvextend -r -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
CREATE TABLE [dbo].[Audit_Info](
[EventTime] [datetime] NULL,
[LoginName] [varchar](255) NULL,
[UserName] [varchar](255) NULL,
[HostName] [varchar](255) NULL,
[ApplicationName] [varchar](255) NULL,
[DatabaseName] [varchar](255) NULL,
[SchemaName] [varchar](255) NULL,
[ObjectName] [varchar](255) NULL,
[ObjectType] [varchar](255) NULL,
// How to create a SQL backup using Drush for D7 and write to file that can later be sent to S3
drush sql-dump | gzip | aws s3 cp - s3://<bucket>/backups/database/dev-full.sql.gz
// Import from S3 directly
aws s3 cp s3://<bucket>/backups/database/dev-full.sql.gz - | gunzip -c | drush sqlc
@jeffbeagley
jeffbeagley / macros
Created July 12, 2019 20:38
Excel Macros
Sub Worksheet_SelectionChange(ByVal Target As range)
If TypeName(Target) = "Range" Then
If Target.Cells.Count > 1 Then
Application.StatusBar = "# of Characters: " & _
Application.Evaluate( _
"=MAX(LEN(" & _
Target.Address & _
":" & _
Target.Address & _
"))" _
@jeffbeagley
jeffbeagley / openconnect.txt
Last active June 10, 2019 05:18
openconnect make and install
//notes on how I manually installed openconnect from source on Ubuntu 19.04
//install dependencies first
sudo apt install libxml2 pkg-config libssl-dev zlib1g-dev
//ensure vpnc script is there
wget http://git.infradead.org/users/dwmw2/vpnc-scripts.git/blob_plain/HEAD:/vpnc-script
sudo mkdir /usr/share/vpnc-scripts/
sudo cp vpnc-script /usr/share/vpnc-scripts/
sudo chmod +x /usr/share/vpnc-scripts/vpnc-script
@jeffbeagley
jeffbeagley / kafka_ksql.yaml
Created December 26, 2018 17:08
KSQL Server running within K8
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: ksql-server
namespace: kafka
labels:
app: ksql-server
spec:
replicas: 1
selector:
@jeffbeagley
jeffbeagley / git_mysql
Last active June 15, 2018 04:24
Easy way to track Git changes with MySQL and Docker
#!/usr/bin/env bash
docker exec CONTAINER_NAME mysqldump -u USERNAME -pPASSWORD DATABASE_NAME --no-data > db_schema_dump/vc.sql
# add outputted sql to current commit
git add db_schema_dump/vc.sql
@jeffbeagley
jeffbeagley / cloudSettings
Last active June 13, 2019 21:46
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-06-13T21:46:55.975Z","extensionVersion":"v3.2.9"}