Skip to content

Instantly share code, notes, and snippets.

View psi-4ward's full-sized avatar

Christoph Wiechert psi-4ward

View GitHub Profile
var config = require('./gulp/config.js');
var commander = require('commander');
var gulp = require('gulp');
var runSequence = require('run-sequence');
var gutil = require('./node_modules/gulp/node_modules/gulp-util/index.js');
var del = require('del');
var glob = require('glob');
var open = require('open');
var config = {
src: __dirname + '/../src/',
dist: __dirname + '/../dist/',
buildTasks: ['jshint', 'app', 'libs', 'copy', 'less'],
buildTasksProd: ['minify-app', 'minify-libs'],
_watchers: []
};
config.libs = [
'bower_components/jquery/dist/jquery.js',
gulp.task('build-stylesheets', function () {
return gulp.src('sources/stylesheets/tenside.less')
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(less({compress: true}))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(rename({suffix:'.min'}))
@psi-4ward
psi-4ward / j_hoverImg.html5
Last active August 29, 2015 14:12
Contao jQuery Template to change the a <img src="img.jpg"> to <img src="img_hover.jpg"> on mouseover
<script>
(function($) {
$(document).ready(function() {
var fadeDuration = 500;
$('.hover-img').each(function(i, el) {
el = $(el);
if(el.css('position') != 'absolute')
el.css('position', 'relative');
@psi-4ward
psi-4ward / LoginController.js
Created January 12, 2015 16:09
Sails.JS JWT Auth
// controllers/LoginController.js
module.exports = {
index: function(req, res) {
var email = req.param('email');
var password = req.param('password');
// delay everthing to prevent bruteforce, dos and timing attacks
setTimeout(function() {
@psi-4ward
psi-4ward / nodemon.json
Created February 2, 2015 18:13
nodemon.json
{
"restartable": "rs",
"ignore": [
"packages/*/angular/",
"packages/*/gulpsi.json"
],
"verbose": false,
"watch": [
"packages/",
"server.js"
@psi-4ward
psi-4ward / README.md
Created April 14, 2015 15:30
CoreOS - Consul - Registrator
  • /opt/bin/etcdctl2 is a wrapper for etcdctl to add certs
  • copy the consul web-ui into /DATA/infra/consul/ui
@psi-4ward
psi-4ward / docker-powerdns-servicediscovery.sh
Created April 15, 2015 08:54
Service Discovery for Docker to update PowerDNS MySQL
#!/bin/bash
# watch events until infinity
UNTIL=99999999999
# respect events 30sec in the past to not forget
# started containers AFTER "register running" but BEFORE event listener starts
SINCE=$(expr `date +%s` - 30)
DOMAIN=fubar
@psi-4ward
psi-4ward / README.md
Last active June 13, 2017 13:02
CoreOS mdadm RAID1 for ROOT

CoreOS mdadm RAID1 for ROOT

  • Setup SoftwareRAID for the CoreOS root partition without data-loss.
  • Only for ext4!
  • The Trick is to use the right volume label and fs-types :)
  • We assume CoreOS is on /dev/sdaX and the second RAID Device is /dev/sdb
  • Drawback: only / gets mirrored, Node goes down when sda fails
  1. Boot into any recovery system like Grml
  2. If not already done: install CoreOS
@psi-4ward
psi-4ward / customize-grml.md
Last active December 2, 2023 06:41
Customize Grml LiveCD (remaster)

Customize Grml LiveCD (remaster)

This little bash script helps you to build your own customized grml.iso

Features

  • Include your .ssh/*.pub files into authorized_keys
  • Inject Grml Cheats
  • Auto download all necessary files (the ISO and grml2usb)