Skip to content

Instantly share code, notes, and snippets.

@groovenectar
groovenectar / roundedcube.scad
Last active April 6, 2024 04:40
roundedcube.scad - Fork me and make me better!
// More information: https://danielupshaw.com/openscad-rounded-corners/
// Set to 0.01 for higher definition curves (renders slower)
$fs = 0.15;
module roundedcube(size = [1, 1, 1], center = false, radius = 0.5, apply_to = "all") {
// If single value, convert to [x, y, z] vector
size = (size[0] == undef) ? [size, size, size] : size;
translate_min = radius;
@snrbrnjna
snrbrnjna / .htaccess
Last active May 10, 2022 01:56
Jekyll Auth Plugin - to manage http basic auth for jekyll generated pages and directories
#### Jekyll Layout: /_layouts/.htaccess
# Apache Configuration File
{% if ((page.auth_dir.users != empty) or (page.auth_dir.groups != empty)) %}
AuthName "Privater Bereich"
AuthType Basic
# => mehrere Require Blocks werden geodert: http://d43.me/blog/1157
AuthzUserAuthoritative Off
AuthUserFile {{ page.auth_remote_user_file }}
@anapsix
anapsix / chat.sh
Last active March 18, 2022 18:24
Chat server with Netcat and Bash, inspired by ITA Software 2011 interview challenge
#!/bin/bash
#
# Implementation of BASH + NCAT chat server
#
# Author: Anastas Dancha <anapsix@random.io>
# Contact: anapsix@random.io
#
#debug="true"
@SirRawlins
SirRawlins / Rakefile
Last active September 15, 2020 06:22
Using Jekyll plugins on GitHub Pages.
# Rquire jekyll to compile the site.
require "jekyll"
# Github pages publishing.
namespace :blog do
#
# Because we are using 3rd party plugins for jekyll to manage the asset pipeline
# and suchlike we are unable to just branch the code, we have to process the site
# localy before pushing it to the branch to publish.
#
@jeroenjanssens
jeroenjanssens / chat.sh
Last active February 15, 2022 21:44
Simple chat server in bash, demonstrating websocketd.
#!/bin/bash
# Hacked together by JeroenJanssens.com on 2013-12-10
# Requires: https://github.com/joewalnes/websocketd
# Run: websocketd --devconsole --port 8080 ./chat.sh
echo "Please enter your name:"; read USER
echo "[$(date)] ${USER} joined the chat" >> chat.log
echo "[$(date)] Welcome to the chat ${USER}!"
tail -n 0 -f chat.log --pid=$$ | grep --line-buffered -v "] ${USER}>" &
while read MSG; do echo "[$(date)] ${USER}> ${MSG}" >> chat.log; done
@virtualstaticvoid
virtualstaticvoid / iptables_rules.sh
Created June 14, 2011 08:58
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
@alx
alx / git.rb
Created December 6, 2010 14:24
Jekyll plugin to add Git activity inside a list
require 'git'
module Jekyll
class GitActivityTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
end
def render(context)