Skip to content

Instantly share code, notes, and snippets.

View romanr's full-sized avatar
😶

Roman Roan romanr

😶
View GitHub Profile
@romanr
romanr / brew-bundle-brewfile-tips.md
Created December 29, 2023 03:59 — forked from ChristopherA/brew-bundle-brewfile-tips.md
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@romanr
romanr / history.zsh
Created December 3, 2023 23:09 — forked from beleidy/history.zsh
Zsh history settings -- taken from oh-my-zsh
## History wrapper
function omz_history {
local clear list
zparseopts -E c=clear l=list
if [[ -n "$clear" ]]; then
# if -c provided, clobber the history file
echo -n >| "$HISTFILE"
echo >&2 History file deleted. Reload the session to see its effects.
elif [[ -n "$list" ]]; then
@romanr
romanr / zshenv
Last active March 27, 2024 12:38 — forked from Linerre/Setting $PATH for zsh on macOS.md
Properly setting $PATH for zsh on macOS (fighting with path_helper)
# zshenv path_helper issue script.
# Source: https://gist.github.com/romanr/2c5ee2eafc284a2530cdb6b8d64d929c
# Based on https://gist.github.com/Linerre/f11ad4a6a934dcf01ee8415c9457e7b2
#
# if [ -f "/etc/zprofile" ] && grep -q "path_helper" "/etc/zprofile"; then
# echo "WARNING: 'path_helper' in '/etc/zprofile', please remove it." >&2
# echo "Path helper 'path_helper' will execute after the one in this '~/.zshenv' file and" >&2
# echo "potentially reorder paths." >&2
# fi
unsetopt GLOBAL_RCS
@romanr
romanr / notion_task_manager.py
Created October 3, 2022 15:05 — forked from jamalex/notion_task_manager.py
Notion task manager toy example
import datetime
import random
import time
from multiprocessing import Lock
from notion.client import *
from notion.block import *
mutex = Lock()
@romanr
romanr / init-redhat.sh
Last active July 12, 2020 10:48 — forked from markusleh/keycloak-defaults
Keycloak service script and default file for init.d
#!/bin/sh
#
# Keycloak control script
#
# chkconfig: - 80 20
# description: Keycloak startup script
# processname: keycloak
# pidfile: /var/run/keycloak/keycloak.pid
# config: /etc/default/keycloak.conf
#
@romanr
romanr / ena_setup_on_ec2.sh
Created November 15, 2019 12:00 — forked from zparnold/ena_setup_on_ec2.sh
Run this script on Ubuntu to enable ENA support.
#!/bin/bash
sudo apt-get update && sudo apt-get upgrade -y
#you may get an error E: Failed to fetch https://sdkrepo.atlassian.com/debian/dists/stable/contrib/binary-amd64/Packages 404 Not Found
#don't worry, you can continue without harm
sudo apt-get install -y build-essential dkms
git clone https://github.com/amzn/amzn-drivers
sudo mv amzn-drivers /usr/src/amzn-drivers-2.1.3
sudo touch /usr/src/amzn-drivers-2.1.3/dkms.conf
echo 'PACKAGE_NAME="ena"
PACKAGE_VERSION="2.1.3"
@romanr
romanr / configure_apcupsd
Created October 7, 2019 12:10 — forked from gschora/configure_apcupsd
configuring apcupsd to suspend all running VM and then shutdown the esxi 5.5 u1 host
###############################################################################################################
# these are instructions for automating the suspend and shutdown of esxi vm's and host in case of a
# power failure.
# works with apc smartups 750xl and esxi 5.5u1
###############################################################################################################
0# make a new VM and install Ubuntu-Server on it
1# install apcupsd
apt-get install apcupsd
@romanr
romanr / configure_apcupsd
Created October 7, 2019 12:10 — forked from gschora/configure_apcupsd
configuring apcupsd to suspend all running VM and then shutdown the esxi 5.5 u1 host
###############################################################################################################
# these are instructions for automating the suspend and shutdown of esxi vm's and host in case of a
# power failure.
# works with apc smartups 750xl and esxi 5.5u1
###############################################################################################################
0# make a new VM and install Ubuntu-Server on it
1# install apcupsd
apt-get install apcupsd
@romanr
romanr / autopgsqlbackup
Created August 21, 2018 14:48 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
@romanr
romanr / db_backup.sh
Created September 5, 2017 11:49 — forked from bendavis78/db_backup.sh
A simple database backup / rotation / prune script
#!/bin/bash
# for use with cron, eg:
# 0 3 * * * postgres /var/db/db_backup.sh foo_db
if [[ -z "$1" ]]; then
echo "Usage: $0 <db_name> [pg_dump args]"
exit 1
fi