Skip to content

Instantly share code, notes, and snippets.

@sivel
sivel / better-ssh-authorized-keys-management.md
Last active March 4, 2026 16:39
Better SSH Authorized Keys Management

Better SSH Authorized Keys Management

A seemingly common problem that people encounter is how to handle all of your users authorized_keys file.

People struggle over management, ensuring that users only have specific keys in the authorized_keys file or even a method for expiring keys. A centralized key management system could help provide all of this functionality with a little scripting.

One piece of functionality overlooked in OpenSSH is the AuthorizedKeysCommand configuration keyword. This configuration allows you to specify a command that will run during login to retrieve a users public key file from a remote source and perform validation just as if the authorized_keys file was local.

Here is an example directory structure for a set of users with SSH public keys that can be shared out via a web server:

@tmornini
tmornini / gist:10551841
Last active November 24, 2015 19:04
Subledger v2 create_and_post JSON body
{
"effective_at": "ISO8601 Date/Time",
"description": "Free form text",
"reference": "URL",
"lines": [
{
"account": "account_id",
"value": {
"type": "debit",
"amount": "10.00"
@kimausloos
kimausloos / HelloController.php
Created March 1, 2014 22:05
In Silex, we can use an KernelEvents::VIEW eventlistener to catch the event that's triggered when a non Response object is returned by the controller. We can then fetch the controller from the request, generate a path to a view and render that. That way we can just return an array() in the controller method and still get a nice html view, just l…
<?php
namespace Thanatos\Controller;
class HelloController
{
public function helloAction($name)
{
return array(
'name' => $name,
@sobstel
sobstel / responsive_youtube.css
Created March 24, 2013 11:22
Responsive embedded youtube video
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px; height: 0; overflow: hidden;
}
.video-container iframe,
.video-container object,
.video-container embed {
position: absolute;
top: 0;
@danvbe
danvbe / 1-Explanations.md
Last active July 23, 2025 05:55
A way to integrate FosUserBundle and HWIOAuthBundle

I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:

  • the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
  • set the service for oauth_user_provider in the security.yml with your custom created service

Here are the steps:

  1. Routing. In routing.yml I have added all the routes for both bundles.
  2. Configuration. I have set the config.yml mostly as it is presented in the HWIOAuthBundle.
  3. Security. I have set the security.yml mostly as it is presented in the HWIOAuthBundle (though my routes are using /login pattern, not /connect). Also, the oauth_user_provider is set for my custom service.
@nickbudi
nickbudi / README.md
Last active November 27, 2025 13:33
Budi's Counter-Strike: Global Offensive config

Budi's CS:GO Config

This is my constantly updated CS:GO autoexec config. Changelogs can be found under revisions here

Put autoexec.cfg in ...\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg or take what you want from it and add to your autoexec config!

After the Wild West Simulator 2015 update, video.txt needs to be put in ...\Steam\userdata\<Steam3 ID>\730\local\cfg

Launch Options

@nblumoe
nblumoe / angularjs_resource_tokenhandler.js
Created July 5, 2012 07:34
AngularJS service to send auth token with $resource requests
.factory('TokenHandler', function() {
var tokenHandler = {};
var token = "none";
tokenHandler.set = function( newToken ) {
token = newToken;
};
tokenHandler.get = function() {
return token;
@justingarrick
justingarrick / eclipse.ini
Last active May 22, 2023 04:48
eclipse.ini settings for Eclipse Indigo/Juno/Kepler & JDK7
-nosplash
--launcher.defaultAction
openFile
-vm
C:/JDK7/jre/bin/server/jvm.dll #Windows
#/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java #OS X
-vmargs
-Xincgc
-Xss1m
-Duser.name=FirstName LastName
@marijn
marijn / Example.php
Created April 3, 2012 16:53
An example on sorting Doctrine\Common\Collection\ArrayCollection elements
<?php
$collection = new Doctrine\Common\Collection\ArrayCollection();
// add objects to the collection that contain a getCreated method returning a DateTime instance
$iterator = $collection->getIterator();
$iterator->uasort(function ($first, $second) {
if ($first === $second) {
@merk
merk / blocks.html.twig
Created November 12, 2011 09:48
A way to deal with collections
{% block address_form %}
{% spaceless %}
<div class="address">
<a href="#" class="remove_item btn danger right">Remove</a>
{{ form_row(address.unitNumber, { "label": "Unit Number" }) }}
{{ form_row(address.streetNumber, { "label": "Street Number" }) }}
{{ form_row(address.street, { "label": "Street" }) }}
{{ form_row(address.city, { "label": "City" }) }}
{{ form_row(address.postcode, { "label": "Postcode" }) }}