Skip to content

Instantly share code, notes, and snippets.

@JPablomr
JPablomr / install-ubuntu-signed-shim.sh
Created September 1, 2023 22:15
Installs ubuntu signed shim on arch, configures/signs grub, the kernel, and sets up signing for dkms (untested)
#!/usr/bin/env zsh
# Installs ubuntu's secure boot shim into the EFI partition.
# While my motherboard allows me to add custom keys and stuff it's
# easier for me to just use this for now.
# WARNING: Here be dragons, this can mess up your bootloader and
# I make no guarantees it won't. Most likely it will and you should
# have a plan to fix it if so (a liveUSB or something that you can use to
# reinstall grub.)
#
@JPablomr
JPablomr / run-wsl.ps1
Created February 26, 2018 04:42
Run WSL seamlessly from powershell
# Windows PowerShell Cookbook is AWESOME
# Turns out you can hook into every aspect of the invocation of a CLI command,
# so when I run a command that's not in powershell, it will also try to run it in WSL
$ExecutionContext.SessionState.InvokeCommand.CommandNotFoundAction = {
param($CommandName, $CommandLookupEventArgs)
# There was a get- that prefixes the command
$realCommand = $CommandName -replace "^get-",""
# Probably more unsafe things, but I can't think of any
$unsafeCommands = @("rm")
@JPablomr
JPablomr / nowplaying.applescript
Created September 30, 2017 18:08
Set Skype Mood Message to what's playing on Spotify
on getCurrentlyPlayingTrack()
tell application "Spotify"
set currentArtist to artist of current track as string
set currentTrack to name of current track as string
return currentArtist & " - " & currentTrack
end tell
end getCurrentlyPlayingTrack
on isSpotifyPlaying()
tell application "Spotify"

Keybase proof

I hereby claim:

  • I am jpablomr on github.
  • I am josemora (https://keybase.io/josemora) on keybase.
  • I have a public key ASB0R5qeZuqijAeXS7bJ-XIYgIRcIisT6KYMsMP4lvtXdAo

To claim this, I am signing this object:

@JPablomr
JPablomr / dpa.service
Created April 17, 2017 15:53
Solarwinds DPA systemd unit file
[Unit]
Description=Solarwinds DPA
After=network.target
After=mysqld.service
[Service]
Environment="JAVA_HOME=/opt/swi_dpa/current/iwc/jre_linux"
Environment="PATH=/opt/swi_dpa/current/iwc/jre_linux/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"
Environment="JAVA_OPTS=-server -Xss300k -Xms256m -Xmx2560 -Djava.net.preferIPv4Stack=true -Dnet.sf.ehcache.skipUpdateCheck=true"
ExecStart=/opt/swi_dpa/current/iwc/tomcat/bin/startup.sh
@JPablomr
JPablomr / container_helpers.sh
Last active November 15, 2016 04:30
Create Containers in proxmox 4
SSH_KEY="your_key_here"
CONTAINER_VOLUME="lxcvols"
create-container(){
local name="$1"
local memory="$2"
local disk="$3"
local ID="$(expr $(pct list | tail -n1 | cut -d" " -f1) + 1)"
require 'time'
require 'date'
class MysqlReplicationMonitor < Scout::Plugin
needs 'mysql'
OPTIONS=<<-EOS
host:
name: Host
notes: The slave host to monitor
default: 127.0.0.1
@JPablomr
JPablomr / MysqlReplicationMonitor.rb
Created May 24, 2016 15:46
Scout's MySQL Replication Monitor, allowing for more than one replication failure before reporting it
require 'time'
require 'date'
class MysqlReplicationMonitor < Scout::Plugin
needs 'mysql2'
OPTIONS=<<-EOS
host:
name: Host
notes: The slave host to monitor