Skip to content

Instantly share code, notes, and snippets.

View jamesbrink's full-sized avatar
💭
:trollface:

James Brink jamesbrink

💭
:trollface:
View GitHub Profile
@hermannolafs
hermannolafs / configuration.nix
Last active June 20, 2024 23:52
Nixos Gnome RDP Remote Desktop
{
# minimized for clarity.
# Some of these might not be needed. After some trial and error
# I got this working with these configs.
# I do not have the patience to rn an elimination test.
services.gnome.gnome-remote-desktop.enable = true;
# Enable the X11 windowing system.
services.xserver.enable = true;
on: [pull_request]
name: Test
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.14.x
@noslin005
noslin005 / BMC and ipmitool.md
Last active January 13, 2024 05:00
Use ipmitool with supermicro boards
  1. Read the fan speed mode:
ipmitool -H <IP> -U <USER> -P <PASSWD> raw 0x30 0x45 0x00

The values are:

  • Standard: 0
  • Full: 1
  • Optimal: 2
  • Heavy IO: 4
@jamesbrink
jamesbrink / README.md
Created July 8, 2019 21:16
DDOS Iptables rules

Aggresive IPTables Rules

echo "service iptables restart"| at now + 2 min

iptables --flush

### Drop invalid packets ### 
iptables -t mangle -A PREROUTING -m conntrack --ctstate INVALID -j DROP
@adam-hanna
adam-hanna / systemd-cloudwatch-logs-tutorial.md
Last active June 12, 2024 04:04
Forward systemd service logs to AWS Cloudwatch

Introduction

I often find myself ssh'ing into my servers and checking my systemd service logs with $ journalctl -f -u {name}.service. One day I got tired of this and wanted all of my important logs in once place (Amazon AWS Cloudwatch). To my dismay, there weren't any real good tutorials on how to do so. So, voilà.

Steps

Overall, it's a fairly simple process consisting of the following few steps.

1. Modify the service file

Open the service file with $ sudo vi /lib/systemd/system/{name}.service

Modify the [Service] section:

@jamesbrink
jamesbrink / patch.patch
Last active July 20, 2019 02:30
the file name is not a typo
From b0a9156259c1ff9f1a0d42a86e08250e37248a0b Mon Sep 17 00:00:00 2001
From: James Brink <brink.james@gmail.com>
Date: Thu, 27 Dec 2018 04:50:56 -0700
Subject: [PATCH] Updated output_files function to prevent segfault.
I have updated the output_files function in patch.c to gracefully
handle the following scenario.
Given a git style patch like the following.
@Francesco149
Francesco149 / docker-cross-device-link.md
Last active October 27, 2023 08:51
docker error creating new backup file '/var/lib/dpkg/status-old': Invalid cross-device link
In order to work the Bose QC35 Headset Bluetooth do the following:
- sudo pacman -Syu pulseaudio-alsa pulseaudio-bluetooth bluez bluez-libs bluez-utils
- turn off bluetooth from your computer
- sudo btmgmt ssp of
- gpasswd -a YOUR_USER lp
@jamesfreeman959
jamesfreeman959 / keepawake.ps1
Last active July 4, 2024 14:59
A very simple PowerShell script to keep a Windows PC awake and make lync think the user is active on the keyboard
# Useful references:
#
# https://superuser.com/questions/992511/emulate-a-keyboard-button-via-the-command-line
# https://ss64.com/vb/sendkeys.html
# https://social.technet.microsoft.com/Forums/windowsserver/en-US/96b339e2-e9da-4802-a66d-be619aeb21ac/execute-function-one-time-in-every-10-mins-in-windows-powershell?forum=winserverpowershell
# https://learn-powershell.net/2013/02/08/powershell-and-events-object-events/
#
# Future enhancements - use events rather than an infinite loop
$wsh = New-Object -ComObject WScript.Shell
while (1) {
@HyperBrain
HyperBrain / lifecycle-cheat-sheet.md
Last active June 7, 2024 05:17
Serverless Lifecycle Cheat Sheet

Serverless plugin author's cheat sheet

This cheat sheet provides a detailed overview of the exposed lifecycle events and available commands (and entrypoints) of the Serverless framework, that can be hooked by plugins (internal and external ones). The document is structured by the commands invoked by the user.

Lifecycle events are shown as the globally available outer events (all providers) and sub lifecycle events that are provider specific in the called order. Currently only the AWS provider is shown. If you have information about the other provider,