Skip to content

Instantly share code, notes, and snippets.

View danielcbaldwin's full-sized avatar

Daniel Baldwin danielcbaldwin

View GitHub Profile
@danielcbaldwin
danielcbaldwin / fail2ban.sh
Created March 12, 2020 17:53
Install Fail2Ban Arch
# Install
yay -S fail2ban
# Configure
sudo vim /etc/fail2ban/jail.d/sshd.local # refer to file below for content
# Enable & Start
sudo systemctl enable fail2ban
sudo systemctl start fail2ban
sudo systemctl restart sshd
@danielcbaldwin
danielcbaldwin / hosts
Created January 25, 2019 02:48
amazon_ota_updates_blocklist
0.0.0.0 d1s31zyz7dcc2d.cloudfront.net
0.0.0.0 amzdigital-a.akamaihd.net
0.0.0.0 amzdigitaldownloads.edgesuite.net
0.0.0.0 softwareupdates.amazon.com
0.0.0.0 updates.amazon.com

Keybase proof

I hereby claim:

  • I am danielcbaldwin on github.
  • I am danielcbaldwin (https://keybase.io/danielcbaldwin) on keybase.
  • I have a public key whose fingerprint is 0FE6 EA8D 6B53 AAFE AD92 AF41 B8E7 29B1 5D23 9672

To claim this, I am signing this object:

@danielcbaldwin
danielcbaldwin / arch_install.sh
Last active September 13, 2018 15:53
Arch Install Manual... dont try to run this file, just follow the steps.
# Boot from the usb, make sure that secure boot is disabled in the BIOS
# Default keymap is set to US
# Connect to wifi
wifi-menu
# Create partitions using cgdisk or fdisk
1 500MB EFI partition # Hex code ef00
2 100% size partition # Hex code 8300
@danielcbaldwin
danielcbaldwin / arch_console_font.sh
Last active July 15, 2022 18:03
Change Console Fonts, Arch Linux
# Install terminus font
yaourt terminus-font
# Set your default font
# NOTE: You can setup the font size and codepage mappings using the font
# definition as shown below.
#
# ter-<X><SIZE><STYLE>
# where <X> is a character identifying the code page as listed bellow
@danielcbaldwin
danielcbaldwin / git_clean.sh
Created October 6, 2014 19:53
Clean up all your local branches except master, develop, and the branch you are on currently
git branch | grep -v "master" | grep -v "develop" | grep -v "^\*" | xargs git branch -D
@danielcbaldwin
danielcbaldwin / ccapp.xml
Created June 27, 2013 02:51
Google gadget xml for the MasteryConnect CCApp
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Common Core Standards" scaling="false" height="600" width="480" gadget_border="false" author="MasteryConnect" author_email="support@masteryconnect.com" />
<Content type="html">
<![CDATA[
<iframe src="http://ccapp.masteryconnect.com" style="border: none;" name="CommonCoreStandards" height="600px" width="480px"></iframe>
]]>
</Content>
</Module>
@danielcbaldwin
danielcbaldwin / delete_dups.py
Created February 17, 2013 06:18
Python script to remove duplicate images / files.
#! /usr/bin/python
# Got this from: http://code.activestate.com/recipes/362459/
import os
import sys
import stat
import md5
filesBySize = {}
@danielcbaldwin
danielcbaldwin / log_producer.rb
Created April 20, 2012 00:01 — forked from anolson/log_producer.rb
Log streaming in ruby.
class LogProducer
attr_accessor :streams
def initialize(options = {})
@streams = Hash.new
@filename = options[:filename]
add_stream(options[:stream])
end
@danielcbaldwin
danielcbaldwin / git_info_addition_to_bash_prompt.sh
Created March 29, 2012 19:41
Git info addition to Bash prompt
# setup the prompt with git branch
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
export PS1='\u:\w$(__git_ps1 "[\[\e[0;32m\]%s\[\e[0m\]\[\e[0;33m\]$(parse_git_dirty)\[\e[0m\]]")$ '
export PROMPT_COMMAND='PS1=$PS1; echo -ne "\033]0;`hostname -s`:`pwd`\007"'