Skip to content

Instantly share code, notes, and snippets.

View jacob-pro's full-sized avatar

Jacob Halsey jacob-pro

View GitHub Profile
@darrenpmeyer
darrenpmeyer / README.md
Created November 20, 2020 19:35
Automatically start a single instance of ssh-agent for all terminal sessions to share (bash)

Installation

  1. mkdir -p ~/.config && touch ~/.config/ssh-agent.pid
  2. Paste the contents of ssh-agent-manage.sh into your .bashrc or .bash_profile or similar
  3. killall -9 ssh-agent
  4. Start a new terminal session (note: old sessions will not see ssh-agent, only new ones)

Details

This snippet, when included in .bashrc, will ensure that your session has a working ssh-agent with all your ssh keys loaded into it. It does this without creating separate ssh-agent processes by:

@RobertAKARobin
RobertAKARobin / python.md
Last active October 12, 2024 17:37
Python Is Not A Great Programming Language
@mdonkers
mdonkers / server.py
Last active November 15, 2024 20:01
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@rahilwazir
rahilwazir / vmdk_vhdx.md
Last active September 4, 2024 14:05
Convert VMWare to Hyper-V (vmdk to vhdx)
@dwilkie
dwilkie / ubuntu_unattended_upgrades_gmail.markdown
Created July 2, 2015 10:28
Setup unattended upgrades on Ubuntu with Gmail

Install the unattended-upgrades package

$ sudo apt-get install unattended-upgrades 

Edit the periodic configuration

$ sudo nano /etc/apt/apt.conf.d/10periodic
@mortenya
mortenya / Remove-OldIISLogs.ps1
Last active September 26, 2024 15:14
Script to run as a Scheduled Task to clean out IIS logs older than 30 days.
<#
Shamelessly liberated from http://foxdeploy.com/2015/02/11/automatically-delete-old-iis-logs-w-powershell/
Because it was better than my own.
#>
$LogPath = "C:\inetpub\logs"
$maxDaystoKeep = -30
$outputPath = "c:\CleanupTask\Cleanup_Old_logs.log"
$itemsToDelete = dir $LogPath -Recurse -File *.log | Where LastWriteTime -lt ((get-date).AddDays($maxDaystoKeep))