Skip to content

Instantly share code, notes, and snippets.

View loitho's full-sized avatar

loitho

View GitHub Profile
@lukeplausin
lukeplausin / transfer_ssm_file.sh
Last active July 17, 2024 13:25
Transfer a file to EC2 SSM instance without using S3 (SSM only)
# This script will explain how to transfer a file to EC2 using SSM ONLY!
# You will need to have permission to run SSM commands on the target machine and have sudo access as well
# Infos
INSTANCE_ID=i-1234567890
FILE_NAME=the_file.tar.gz
# Step 1: Run command on machine to install netcat and dump from port to filename
# < Start session
@bomberstudios
bomberstudios / keeps_in_europe.md
Created October 4, 2020 14:27
Keyboard Shops in Europe
@Velocet
Velocet / Unlock-PowerCfg.ps1
Last active July 15, 2024 23:05
Unlock/Unhide all Power Plan Settings/Options on Windows 10/11
#Requires -RunAsAdministrator
# Unlock-PowerCfg - v22.05.11
# Disable "Connected Standby"
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Power' -Name 'CSEnabled' -Value 0 -Force
# Get Power Settings entries and add/set 'Attributes' to 2 to unhide
$PowerCfg = (Get-ChildItem 'HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerSettings' -Recurse).Name -notmatch '\bDefaultPowerSchemeValues|(\\[0-9]|\b255)$'
foreach ($item in $PowerCfg) { Set-ItemProperty -Path $item.Replace('HKEY_LOCAL_MACHINE','HKLM:') -Name 'Attributes' -Value 2 -Force }
@jclaret
jclaret / Satellite
Last active December 2, 2021 15:56
# Satellite
## Tasks Status
sudo su - postgres -c "psql -d foreman -c 'select label,count(label),state,result from foreman_tasks_tasks where state <> '\''stopped'\'' group by label,state,result ORDER BY label;'"
## Foreman-rake commands - https://access.redhat.com/solutions/1754193
### Cancel Tasks
> foreman-rake console
irb(main):001:0> ForemanTasks::Task.find("799bc5fb-2d4c-4d0d-9d7d-4e42e9a8ace8").destroy
### Synchronize a repository from CDN
@kaysond
kaysond / fanctl.sh
Last active June 1, 2024 17:26
Dell Poweredge R710 R720 Fan Noise Control Script
#!/usr/bin/env bash
#You'll need to enable IPMI over lan in idrac first
#iDRAC Settings -> Network -> IPMI Settings
#Channel Privilege Level Limit needs to be Administrator
#You may want to create a dedicated username/pass with IPMI permission in iDRAC Settings -> User Authentication
IPMIHOST=idracip
IPMIUSER=username
IPMIPW=password
IPMIEK=0000000000000000000000000000000000000000
@thedoc31
thedoc31 / grafana-dashboard-import.sh
Last active November 7, 2022 12:53
Bash script to batch Import dashboard JSON files into Grafana. Verified working on v6.3. This script is based on the Grafana dashboard export script originated on https://gist.github.com/crisidev/bd52bdcc7f029be2f295
#!/bin/bash
#
# add the "-x" option to the shebang line if you want a more verbose output
#
#
OPTSPEC=":hp:t:k:"
show_help() {
cat << EOF
Usage: $0 [-p PATH] [-t TARGET_HOST] [-k API_KEY]
@mgbckr
mgbckr / install_zsh_on_sherlock.sh
Last active April 8, 2024 05:49
Compiling and installing Zsh without root privileges on Stanford's Sherlock (https://sherlock.stanford.edu) for use in tmux
# Update 2023-07-20:
# I've recently switched to installing `zsh` via `conda` which is a lot less hassle.
# I added it to start automatically in `tmux` with
# `set-option -g default-shell "~/miniconda3/envs/default/bin/zsh"`
#
# # Install Zsh on Sherlock
# Installs Zsh with Oh-My-Zsh without root privileges
# on Stanford's Sherlock (https://sherlock.stanford.edu) for use in tmux
#
# ## Instructions
@tony-caffe
tony-caffe / nagios-slack-alert.sh
Last active May 10, 2024 19:18
Nagios to post alerts into a Slack channel # using the Incoming WebHooks integration
#!/bin/bash
# This script is used by Nagios to post alerts into a Slack channel
# using the Incoming WebHooks integration. Create the channel, botname
# and integration first and then add this notification script in your
# Nagios configuration.
#
# All variables that start with NAGIOS_ are provided by Nagios as
# environment variables when an notification is generated.
# A list of the env variables is available here:
@voluntas
voluntas / sysctl.conf
Created October 14, 2017 13:07 — forked from techgaun/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
@olivertappin
olivertappin / create-large-file.sh
Last active March 7, 2023 06:36
Create a large file for testing
# Please note, the commands below will create unreadable files and should be
# used for testing file size only. If you're looking for something that has
# lines in it, use /dev/urandom instead of /dev/zero. You'll then be able to
# read the number of lines in that file using `wc -l large-file.1mb.txt`
# Create a 1MB file
dd if=/dev/zero of=large-file-1mb.txt count=1024 bs=1024
# Create a 10MB file
dd if=/dev/zero of=large-file-10mb.txt count=1024 bs=10240