Skip to content

Instantly share code, notes, and snippets.


Farhad Shahbazi Grauwolf

  • Vienna
View GitHub Profile
ahmetb /
Last active Feb 26, 2021
Script to clean up Google Container Registry images pushed before a particular date
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Unless required by applicable law or agreed to in writing, software
4poc / bintest.js
Created Oct 11, 2016
Buffer Schema Type in Mongoose: How to specify subtype
View bintest.js
'use strict';
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const ObjectId = Schema.Types.ObjectId;
const MongooseBuffer = mongoose.Types.Buffer;
const uuid = require('node-uuid');
const db = require('../lib/database');
conspect /
Last active Nov 10, 2020
A Cult Of Ignorance, Isaac Asimov

It's hard to quarrel with that ancient justification of the free press: "America's right to know." It seems almost cruel to ask, ingeniously, "America's right to know what, please? Science? Mathematics? Economics? Foreign languages?"

None of those things, of course. In fact, one might well suppose that the popular feeling is that Americans are a lot better off without any of that tripe.

There is a cult of ignorance in the United States, and there always has been. The strain of anti-intellectualism has been a constant thread winding its way throughout political and cultural life, nurtured by the false notion that democracy means that "my ignorance is just as good as your knowledge."

Politicians have routinely striven to speak the language of Shakespeare and Milton as ungrammaticaly as possible in order to avoid offending their audiences by appearing to have gone to school. Thus, Adlai Stevenson, who incautiously allowed intelligence and learning and wit to peep out of his speeches, found the American people

EvilGrinUK /
Last active Aug 13, 2019
LVM Snapshot Backup - Takes a snapshot of each logical volume in a volume group and creates a compressed dd copy in a specific directory.
for lv in $(lvs --noheadings --nosuffix --aligned --separator , -o lv_name,lv_attr | grep -v ,s | cut -d, -f1)
LV_SIZE="$(lvs --units m --noheadings --nosuffix --aligned --separator , -o lv_name,lv_size | grep "$lv" | cut -d',' -f2 | cut -d. -f 1)" # LV size in MB
azet / get_alexa_1m_mx_rrs
Last active Sep 6, 2017
Retrieves MX and A records for 'Alexa Top 1 Million' hosts and prints them as pretty formatted JSON objects to stdout.
View get_alexa_1m_mx_rrs
#!/usr/bin/env bash
# Retrieves MX and A records for 'Alexa Top 1 Million' hosts
# and prints them as pretty formatted JSON objects to stdout.
# *Optional* parallelism support with GNU Parallel (recommended):
# $ sudo apt-get install parallel
# Authors: Aaron Zauner <>
# License: CC0 1.0 (
drkarl / gist:739a864b3275e901d317
Last active Sep 10, 2020
Ask HN: Best Linux server backup system?
View gist:739a864b3275e901d317

Linux Backup Solutions

I've been looking for the best Linux backup system, and also reading lots of HN comments.

Instead of putting pros and cons of every backup system I'll just list some deal-breakers which would disqualify them.

Also I would like that you, the HN community, would add more deal breakers for these or other backup systems if you know some more and at the same time, if you have data to disprove some of the deal-breakers listed here (benchmarks, info about something being true for older releases but is fixed on newer releases), please share it so that I can edit this list accordingly.

Amanda (comments by sammcj)

  • It has a lot of management overhead and that's a problem if you don't have time for a full time backup administrator.
View gist:5d90091db803f52b618d
package main
import (
4poc / gist:c279d24157af06d12cbe
Last active Aug 1, 2020
GOZORK Text Adventure Game
View gist:c279d24157af06d12cbe
* GOZORK Text Adventure Game
* by apoc <>
* Inspired by the infamous beginning of Zork I.
* Reading the source will obviously spoil the game.
* The goal is to somehow kill the troll.
* Oh yeah and: This is my first GO program! Which would be
* my perfect excuse for the bad code quality1!
* Here is a solution/transcript:
ruario /
Last active Jun 22, 2020
This script provides a method for creating generic (cross-distro), installable, binary packages. The created packages include a log that makes uninstall easy.



This script provides a simple method for tracking software that you have built from source, or binaries that you want to repackage from another distribution. It also simplifies transferring the software to other machines for install or backup. It works as a nice secondary package management tool, without the need to work with complex, distro specific, build tools.

# This gist is compatible with Ansible 1.x .
# For Ansible 2.x , please check out:
# -
# -
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.