Skip to content

Instantly share code, notes, and snippets.

@casualjim
casualjim / OVH IPv6 Ubuntu.md
Last active January 21, 2023 20:03
Actually working IPv6 dedicated server configuration for ubuntu

Configure IPv6 on Ubuntu 20.04 on OVH dedicated

Contrary to the guide, do this instead

the gateway is in the /56 network but so you have to get your ip in there.

Edit: /etc/netplan/50-cloud-init.yaml

# This file is generated from information provided by the datasource. Changes
@john-kurkowski
john-kurkowski / ForwardingFieldDescriptor.scala
Created February 19, 2013 02:38
Scalatra FieldDescriptor that shows .value and .validation as empty for optional, default-less fields. Useful when you want to distinguish these fields being provided or not, and when they have no convenient DefaultValue (zero).
package org.scalatra.commands
import org.scalatra.DefaultValue
import org.scalatra.util.conversion.TypeConverter
abstract class ForwardingFieldDescriptor[T](delegate: FieldDescriptor[T]) extends FieldDescriptor[T] {
protected def copy(newDelegate: FieldDescriptor[T]): ForwardingFieldDescriptor[T]
override def name = delegate.name
@narcisobenigno
narcisobenigno / WebAppWithJetty.scala
Created August 5, 2012 03:47
SBT configs to use Jetty 8.1.x
import sbt._
import Keys._
import com.github.siasia._
import WebPlugin._
import WebappPlugin._
import PluginKeys._
object WebAppWithJetty extends Build {
lazy val root = Project(
@casualjim
casualjim / hack.sh
Created March 31, 2012 23:15 — forked from nrk/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@casualjim
casualjim / WebSocketClient.scala
Created February 13, 2012 19:42
A Netty based WebSocket client and server in scala
package mojolly.io
import org.jboss.netty.bootstrap.ClientBootstrap
import org.jboss.netty.channel._
import socket.nio.NioClientSocketChannelFactory
import java.util.concurrent.Executors
import org.jboss.netty.handler.codec.http._
import collection.JavaConversions._
import websocketx._
import java.net.{InetSocketAddress, URI}
@casualjim
casualjim / resque.scala
Created March 17, 2011 17:40
A resque implementation in scala with akka actors and scala-redis
package com.mojolly.backchat
package redis
package resque
import com.mojolly.backchat.redis.resque.Resque.{ResqueWorkerActor}
import net.liftweb.json._
import JsonAST._
import JsonDSL._
import java.net.InetAddress
import com.redis.ds.{ RedisDeque, RedisDequeClient }
@Pablosan
Pablosan / ec2_instance_create_and_setup.sh
Created January 30, 2011 23:37
A bash script that will set up a new EC2 instance and ssh into it.
#!/bin/bash
# Authorize TCP, SSH & ICMP for default Security Group
#ec2-authorize default -P icmp -t -1:-1 -s 0.0.0.0/0
#ec2-authorize default -P tcp -p 22 -s 0.0.0.0/0
# The Static IP Address for this instance:
IP_ADDRESS=$(cat ~/.ec2/ip_address)
# Create new t1.micro instance using ami-cef405a7 (64 bit Ubuntu Server 10.10 Maverick Meerkat)
@mrflip
mrflip / gist:766608
Created January 5, 2011 17:15
Elasticsearch shell config
We couldn’t find that file to show.