Skip to content

Instantly share code, notes, and snippets.

View mnowotnik's full-sized avatar

Michał Nowotnik mnowotnik

View GitHub Profile
@jonasgeiler
jonasgeiler / copy-fontsource-fonts.js
Created December 11, 2021 23:17
A little script which copies fonts installed with fontsource from the installation path to a local folder
const path = require('path');
const fs = require('fs/promises');
// ---------------------------------------- CONFIG ---------------------------------------- //
/**
* Add the fonts to copy here.
* Make sure you've installed the Fontsource package for the font!
* Uses the same font family format as the Google Font API.
@ageis
ageis / systemd_service_hardening.md
Last active May 4, 2024 15:57
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@mattiaslundberg
mattiaslundberg / Ansible Let's Encrypt Nginx setup
Last active April 19, 2024 16:03
Let's Encrypt Nginx setup with Ansible
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@ben-axnick
ben-axnick / 2015-11-yadm.md
Created January 22, 2016 00:33
How to manage dotfiles with YADM

Background

Solutions I've tried

  • Git repo directly checked out in home directory

    • Noisy
    • Have to ignore *, everything is a --force
    • Juggling machine variations is a pain
  • Homesick / Homeshick

@n00neimp0rtant
n00neimp0rtant / gist:9515611
Last active March 14, 2024 06:30
simple squash without rebase
## within current branch, squashes all commits that are ahead of master down into one
## useful if you merged with upstream in the middle of your commits (rebase could get very ugly if this is the case)
## commit any working changes on branch "mybranchname", then...
git checkout master
git checkout -b mybranchname_temp
git merge --squash mybranchname
git commit -am "Message describing all squashed commits"
git branch -m mybranchname mybranchname_unsquashed
git branch -m mybranchname
@mlouro
mlouro / gulpfile.js
Last active June 21, 2022 23:20
gulpfile.js with browserify, jshint, libsass, browserSync for livereload, image optimization and system notifications on errors
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var uglify = require('gulp-uglify');
var gulpif = require('gulp-if');
var exec = require('child_process').exec;
var notify = require('gulp-notify');
@gaspard
gaspard / simple_jit.lua
Created July 17, 2011 09:05
Testing Luajit bindings to C++
-- luajit simple_jit.lua
ffi = require 'ffi'
simple = ffi.load('simple')
ffi.cdef[[
typedef struct Simple Simple;
Simple *Simple_Simple(int);
void Simple__gc(Simple *);
@gaspard
gaspard / gist:1087380
Created July 17, 2011 09:02
Simple C++ class with C interface for Luajit ffi bindings
// g++ simple.cpp -shared -o libsimple.dylib
#include <stdio.h>
class Simple {
int id_;
public:
Simple(int id);
~Simple();