Skip to content

Instantly share code, notes, and snippets.

Farhad Shahbazi Grauwolf

  • Vienna
Block or report user

Report or block Grauwolf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ahmetb
ahmetb / gcrgc.sh
Last active Sep 6, 2019
Script to clean up Google Container Registry images pushed before a particular date
View gcrgc.sh
#!/bin/bash
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@4poc
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
conspect / cult_of_ignorance.md
Last active Apr 22, 2019
A Cult Of Ignorance, Isaac Asimov
View cult_of_ignorance.md

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
EvilGrinUK / lvm_backup.sh
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.
View lvm_backup.sh
#!/bin/bash
VG_NAME="vg0"
SNAPSHOT_SIZE="+2G"
BACKUP_LOCATION="/backups"
DAYSTOKEEP=7
for lv in $(lvs --noheadings --nosuffix --aligned --separator , -o lv_name,lv_attr | grep -v ,s | cut -d, -f1)
do
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
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 <azet@azet.org>
# License: CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0)
@drkarl
drkarl / gist:739a864b3275e901d317
Last active Jul 2, 2019
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 (
"bufio"
"crypto/tls"
"fmt"
"io"
"net"
"reflect"
"regexp"
@4poc
4poc / gist:c279d24157af06d12cbe
Last active Dec 3, 2016
GOZORK Text Adventure Game
View gist:c279d24157af06d12cbe
/**
* GOZORK Text Adventure Game
* by apoc <http://apoc.cc>
*
* 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
ruario / README.md
Last active Feb 16, 2019
This script provides a method for creating generic (cross-distro), installable, binary packages. The created packages include a log that makes uninstall easy.
View README.md

Createpkg

Intro

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.

View human_log.py
# This gist is compatible with Ansible 1.x .
# For Ansible 2.x , please check out:
# - https://gist.github.com/dmsimard/cd706de198c85a8255f6
# - https://github.com/n0ts/ansible-human_log
# 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.
#
You can’t perform that action at this time.