Skip to content

Instantly share code, notes, and snippets.

View deoren's full-sized avatar
💭
I may be slow to respond.

Deoren Moor deoren

💭
I may be slow to respond.
View GitHub Profile
#!/bin/sh
# Echo all commands to stdout
set -x
# Fail on non-zero exit status
set -e
# Install puppet and passenger
gem install puppet passenger --no-ri --no-rdoc
@alanorth
alanorth / default.conf
Last active July 25, 2019 04:58
TLS configuration for nginx, reverse proxying to DSpace in Tomcat.
# Handle {{ nginx_server_name }} http -> https
#
server {
listen 80;
server_name {{ nginx_server_name }};
# feedburner doesn't support https :(
location ~ /(feed|open-search/discover) {
# Send requests to Tomcat
proxy_pass http://127.0.0.1:8443;
@mweisel
mweisel / Get-DiskFree.ps1
Last active December 6, 2023 00:39
PowerShell advanced function (script cmdlet) to query, retrieve, and display local drive/disk information. (https://binarynature.blogspot.com/2010/04/powershell-version-of-df-command.html)
function Get-DiskFree
{
[CmdletBinding()]
param
(
[Parameter(Position=0,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)]
[Alias('hostname')]
[Alias('cn')]
@stupidpupil
stupidpupil / gist:83be3a5d0daf3db17b2b
Created April 16, 2015 23:59
FreeOTP Tokens.xml Exporter
#!/usr/bin/env ruby
module GoogleBase32
Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" #RFC4648
Digits = Alphabet.chars
Mask = Digits.length - 1
Shift = Digits.length.to_s(2).match(/0*\Z/)[0].length
def self.encode_array(array)
@vstakhov
vstakhov / rmilter.md
Created September 8, 2015 14:38
rmilter plans

Plans for rmilter

What's wrong

Rmilter had been created some years before rspamd development started. Unfortunately, it wasn't actively developed for many years so far. It has several design flaws, it uses archaic configuration system, it uses threads, it contains a lot of duplicated functions with rspamd and, finally, it has a lot of code shared with rspamd (but it's not always up-to-date however). I hasn't found anybody willing to support this code as a separate project, so I think it's a good point to stop and think of what to do afterwards.

What's proposed to do

After some thinking I've decided to reorganize rmilter project and to integrate it to the rspamd meta-project.

@jhamilton09
jhamilton09 / UninstallQuickTime.ps1
Created April 19, 2016 15:15
PowerShell script to uninstall QuickTime for Windows
<#
Name of the script: UninstallQuickTime.ps1
Author of the script: Jason Hamilton
Author contact information: https://www.404techsupport.com/
Version of the script: 0.1
Where you got the idea: QuickTime deprecated by Apple
Version of PowerShell required: 3.0
If Elevated permissions required: Yes
If specific modules are required: No
Comments about new types of constructions:
@alces
alces / ansible_ad_hoc_inventories.md
Last active September 2, 2022 07:17
Using Ad-hoc Inventories in Ansible

In case you want to run ansible (or ansible-playbook) command against a set of hosts that makes sense only for one run, you can don't bother to create one-time inventory file, but simply define a comma-separated list of hosts as argument of --invertory option (or its short form that's simply -i) as follows:

ansible --inventory=myhost1,myhost2,myhost3 all -m setup -a 'filter=*name*'

(note that all in this command line stands for the target hostname)

If you have only one host to run your playbook against, your inventory string must ends with ,

@bgromov
bgromov / git-reset-author.sh
Created June 23, 2016 17:50
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
@rgl
rgl / wait_for_http_200.sh
Last active February 18, 2025 11:37
Wait for an HTTP endpoint to return 200 OK with Bash and curl
bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9000)" != "200" ]]; do sleep 5; done'
# also check https://gist.github.com/rgl/c2ba64b7e2a5a04d1eb65983995dce76