Skip to content

Instantly share code, notes, and snippets.

@petervanderdoes
petervanderdoes / dovecot
Last active February 1, 2017 01:06
Dovecot file used for Logwatch.
#!/usr/bin/perl
########################################################
# $Id: dovecot 293 2015-03-27 16:01:35Z opoplawski $
########################################################
# $Log: dovecot,v $
# Revision 1.18 2010/09/18 17:41:00 stefan
# ignore: ssl-build-param
#
# Revision 1.17 2009/06/02 14:48:06 mike
# Removed some periods that were in the Fedora patch and broke the file -mgt
@0XDE57
0XDE57 / config.md
Last active May 14, 2025 03:10
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable. I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere No longer required: Enable HTTPS-Only Mode, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@Rplus
Rplus / random-text-in-page.js
Last active August 29, 2015 14:27
Usability 測試的 bookmarklet
// fork from https://blog.gslin.org/archives/2015/08/14/5926/
// re-build to jQuery independence script
javascript: (function() {
'use strict';
var rStr = ' ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var rStrLen = rStr.length;
function textNodesUnder(node) {
node = node.firstChild;
@joshluongo
joshluongo / Commands.xml
Last active October 18, 2020 18:24
Sony BRAVIA KDL-55EX720 Remote Commands
<?xml version="1.0"?>
<remoteCommandList>
<command name="Confirm" type="ircc" value="AAAAAQAAAAEAAABlAw=="/>
<command name="Up" type="ircc" value="AAAAAQAAAAEAAAB0Aw=="/>
<command name="Down" type="ircc" value="AAAAAQAAAAEAAAB1Aw=="/>
<command name="Right" type="ircc" value="AAAAAQAAAAEAAAAzAw=="/>
<command name="Left" type="ircc" value="AAAAAQAAAAEAAAA0Aw=="/>
<command name="Home" type="ircc" value="AAAAAQAAAAEAAABgAw=="/>
<command name="Options" type="ircc" value="AAAAAgAAAJcAAAA2Aw=="/>
<command name="Return" type="ircc" value="AAAAAgAAAJcAAAAjAw=="/>
@sp3c73r2038
sp3c73r2038 / subprocess.php
Last active August 29, 2015 14:11
a toolkit function for PHP
<?php
// I know, I know, there are proc_open, exec, system functions to use.
// But they just suck...
// So I wrote this, hope this will help ourselves out :3
function subprocess($cmd, $login = FALSE, $cwd = './',
$shell = '/bin/bash', $pipespec = NULL) {
$pid = getmypid();
@andrewdelprete
andrewdelprete / laracon-2014-notes.md
Last active November 19, 2018 17:19
My notes from Laracon 2014

###Jeffrey Way (1) - Bootcamp

Jeffrey went through about 12 subjects one right after the other and gave tips along the way.

  1. Mail Drivers for mail notifications.
1. With Laravel 4.2 it’s easier to use APIs like Mailgun and Mandrill for e-mail notifications. This avoids using SMTP which is really cool.
  1. File Generators for generating schema migrations.
@kvzhuang
kvzhuang / Dockerfile
Last active September 17, 2018 12:12
My Dockerfile, initial shell script and run shell script.
# DOCKER-VERSION 0.3.4
FROM ubuntu
MAINTAINER Kevin Zhuang <[email protected]>
#RUN echo "This is a ubuntu Dockerfile."
#replace source.list with http://repogen.simplylinux.ch/
RUN echo "deb http://02.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse" > /etc/apt/sources.list
RUN apt-get update
@tortuetorche
tortuetorche / 01.FiniteAuditTrail.README.md
Last active May 14, 2024 08:21
FiniteAuditTrail Trait For Laravel 4 with Example. Support for keeping an audit trail for any state machine, borrowed from the Ruby StateMachine audit trail gem.

FiniteAuditTrail Trait

Support for keeping an audit trail for any state machine, borrowed from the Ruby StateMachine audit trail gem. Having an audit trail gives you a complete history of the state changes in your model. This history allows you to investigate incidents or perform analytics, like: “How long does it take on average to go from state a to state b?”, or “What percentage of cases goes from state a to b via state c?”

Requirements

  1. PHP >= 5.4
  2. Laravel 4 framework
@hugozhu
hugozhu / douban.php
Created January 3, 2013 05:10
Raspberry Pi上听豆瓣电台的简易方法:sudo apt-get install mpg123 php5-cli,然后执行本程序即可
#!/usr/bin/env php
<?php
function fetch_page($url, $timeout = 5) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);