Skip to content

Instantly share code, notes, and snippets.

@seungwon0
seungwon0 / Whatthecommit
Created January 30, 2011 02:56
Random commit message generator
#! /bin/sh
#
# whatthecommit - Random commit message generator
#
# Show random commit message from http://whatthecommit.com/.
#
# Seungwon Jeong <[email protected]>
#
# Copyright 2011 by Seungwon Jeong
@aniruddha-adhikary
aniruddha-adhikary / ubuntu-release-checker.py
Last active March 21, 2016 16:45
ubuntu release checker
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib
import json
version = "15.10"
arch = "i386" # i386 or amd64
mirrorlist = ["http://ubuntu.mirror.mendoza-conicet.gob.ar/", "http://releases.ubuntu.unc.edu.ar/", "http://ftp.iinet.net.au/pub/ubuntu-releases/", "http://mirror.aarnet.edu.au/pub/ubuntu/releases/", "http://mirror.netspace.net.au/pub/ubuntu-releases/", "http://ubuntu.mirror.serversaustralia.com.au/ubuntu-releases/", "http://ubuntu.mirror.uber.com.au/releases/", "http://mirror.internode.on.net/pub/ubuntu/releases/", "http://ubuntu.lagis.at/releases/", "http://mirrors.ispros.com.bd/ubuntu-release/", "http://by.releases.ubuntu.com/", "http://ubuntu-releases.mirror.nucleus.be/", "http://ubuntu.mirrors.skynet.be/pub/ubuntu.com/releases/", "http://bw.releases.ubuntu.com/", "http://ubuntu.c3sl.ufpr.br/releases/", "http://mirror.globo.com/ubuntu/releases/", "http://mirror.pop-sc.rnp.br/mirror/ubuntu/", "http://ubuntu.mirror.pop-sc.rnp.br/mirror/ubuntu-releases/", "http://mirror.unesp.br/ubuntu
@salmanmorshed
salmanmorshed / urtscore.py
Last active December 30, 2015 18:49
Module to calculate the individual scores of all players from a games.log file generated by Urban Terror.
#!/usr/bin/env python
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@salmanmorshed
salmanmorshed / autoexec_cfg
Last active October 4, 2016 00:03
Zed's UrT Config
// ==================================== //
// ZED'S PERSONAL KEYBINDS AND SETTINGS //
// ------------------------------------ //
// *** Last updated @ 4 Oct 2016 *** //
// ==================================== //
//Personal
//set m_filter "0"
//set sensitivity 2.20 // 2400 CPI & OS X 0.0 mouse scaling
@salmanmorshed
salmanmorshed / PatchWebDriver.sh
Created October 31, 2015 12:02
Execute script inside the directory containing Nvidia Web Driver installer to create a patched copy
#!/bin/bash
# =========================================================================
# Patches Nvidia Web Driver installers for installing on non-MacPro devices
# By: Md. Salman Morshed - [email protected]
# =========================================================================
PKG_FILE="$(ls | grep WebDriver | head -1)"
TMP_DIR="$PKG_FILE.temp"
@grizmio
grizmio / gist:bc752dd070652f21266b
Created November 17, 2015 19:53
Patch to make Adafruit's ADC python libraries works with ubuntu xenial, kernel 4
diff --git a/source/c_adc.c b/source/c_adc.c
index e0c754c..5269407 100644
--- a/source/c_adc.c
+++ b/source/c_adc.c
@@ -30,29 +30,28 @@ SOFTWARE.
#include "c_adc.h"
#include "common.h"
-char adc_prefix_dir[40];
+char adc_prefix_dir[49];
@xkr47
xkr47 / letsencrypt-jetty.sh
Last active June 26, 2024 09:03
How to use Letsencrypt certificate & private key with Jetty
# input: fullchain.pem and privkey.pem as generated by the "letsencrypt-auto" script when run with
# the "auth" aka "certonly" subcommand
# convert certificate chain + private key to the PKCS#12 file format
openssl pkcs12 -export -out keystore.pkcs12 -in fullchain.pem -inkey privkey.pem
# convert PKCS#12 file into Java keystore format
keytool -importkeystore -srckeystore keystore.pkcs12 -srcstoretype PKCS12 -destkeystore keystore.jks
# don't need the PKCS#12 file anymore
using System;
using System.Runtime.InteropServices;
// ReSharper disable SuspiciousTypeConversion.Global
// ReSharper disable InconsistentNaming
namespace VideoPlayerController
{
/// <summary>
/// Controls audio using the Windows CoreAudio API
/// from: http://stackoverflow.com/questions/14306048/controling-volume-mixer
@sknuell
sknuell / PHPNativeFunctionMock.php
Last active February 10, 2021 22:22
Mocking native PHP functions (date(), time() and shell_exec) for PHPUnit using php-mock/php-mock and php-mock/php-mock-phpunit
<?php
namespace Foo\Bar;
use phpmock\MockBuilder;
use phpmock\phpunit\PHPMock;
use PHPUnit_Framework_TestCase;
class Baz
{
/**
@fnky
fnky / ANSI.md
Last active November 16, 2024 01:32
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27