Skip to content

Instantly share code, notes, and snippets.

View jgiambona's full-sized avatar

jgiambona

View GitHub Profile
[Service]
Environment=STARTUP_WAIT=30s
ExecStart=/home/kobus/.local/bin/power_monitor.sh
[Install]
WantedBy=default.target
#! /bin/bash
BAT=$(echo /sys/class/power_supply/BAT*)
BAT_STATUS="$BAT/status"
BAT_CAP="$BAT/capacity"
LOW_BAT_PERCENT=20
AC_PROFILE="performance"
BAT_PROFILE="balanced"
LOW_BAT_PROFILE="power-saver"
@juananpe
juananpe / wb_admin_export_options.py
Created May 3, 2020 16:03
Patched wb_admin_export_options.py to avoid the "Unknown table 'COLUMN_STATISTICS' in information_schema (1109)" dreaded error
# Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# but not limited to OpenSSL) that is licensed under separate terms, as
# designated in a particular file or component or in included license
# documentation. The authors of MySQL hereby grant you an additional
@iredmail
iredmail / split-mail-delivery.md
Last active November 18, 2022 04:57
Split mail delivery

Split mail delivery

####################################################################
## THIS IS A DRAFT DOCUMENT.                                      ##
## DO NOT APPLY IT ON PRODUCTION SERVER WITHOUT TESTING.          ##
####################################################################

Summary

@bjsion
bjsion / Installing Odoo on AWS
Last active April 16, 2024 09:36
Installing Odoo ERP on AWS using RDS and EC2
# Installing Odoo on AWS
These are the steps I ran to get Odoo up and running on AWS using the free tiers (for now).
## Setup servers
### Create DB
Create an Postgres DB on Amazon RDS:
https://us-east-2.console.aws.amazon.com/rds/home?region=us-east-2#launch-dbinstance:ct=dbinstances:
### Create Server
@ianthetechie
ianthetechie / Twilio Asterisk Secure Trunking HOWTO.md
Last active November 1, 2023 16:01
A short guide on how to set up an encrypted VoIP system using Twilio and Asterisk.

Twilio Asterisk Secure Trunking HOWTO

This is a short guide on how to set up an encrypted VoIP system using Twilio and Asterisk. I was a little annoyed that just about everything these days still uses unencrypted RTP for media (though just about everyone supports SIP over TLS). So I spent a weekend looking at options, and settled on a totally overkill solution involving Twilio's secure trunking to an Asterisk PBX. While all bets are off once it hits the PSTN, at least you won't be blasting your conversations over the internet in clear text.

@marcelkornblum
marcelkornblum / export_repo_issues_to_csv.py
Last active December 18, 2023 20:20 — forked from unbracketed/export_repo_issues_to_csv.py
Export Issues from Github repo to CSV (API v3)
"""
This is strongly based on https://gist.github.com/unbracketed/3380407;
thanks to @unbracketed and the various commenters on the page.
I've mainly cleaned up the code into basic methods, and included the
various suggestions in the comments. Hope this is useful to someone.
Make sure you have `requests` and `csv` installed via pip then run it:
`python export_gh_issues_to_csv.py`
@zthomas
zthomas / intercom-delete-old-users.js
Last active May 1, 2023 15:28
Script to delete and clear old users from intercom. Useful for lowering the monthly bill
// License: MIT, feel free to use it!
const Intercom = require('intercom-client');
const appId = 'APP_ID'
const apiKey = 'APP_KEY'
const client = new Intercom.Client(appId, apiKey);
const async = require('async-q')
//REF: https://developers.intercom.com/reference#iterating-over-all-users
//WARNING: you can only have one scroll working at once. you need to wait for that scroll to clear to try again
@pranid
pranid / Amortization.php
Last active May 1, 2024 15:05
Amortization Schedule Example -- PHP Version
<?php
/**
* AMORTIZATION CALCULATOR
* @author PRANEETH NIDARSHAN
* @version V1.0
*/
class Amortization
{
private $loan_amount;
private $term_years;

Deploy your site with git securely

This gist assumes:

  • you have a local git repo
  • you have an online remote repository (github)
  • you have a server running Apache with git already installed

you should be able to do the same with Java, Perl, RoR, JSP etc. however you'll need to recreate the (rather simple) PHP script