Skip to content

Instantly share code, notes, and snippets.

@softminus
softminus / min_duty_cycle_settei.sh
Created February 6, 2020 01:58
Set minimum fan speed on Fujitsu/Kontron motherboards with Teutates BMC
#!/bin/bash
# Copyright (C) 2020 Kia
# Licensed under Zero Clause BSD License
if [[ $# -ne 3 ]]; then
echo "usage: $0 (BMC I2C BUS NUMBER) (FAN PAGE) (DUTY CYCLE FLOOR)"
echo ""
echo "BMC I2C BUS NUMBER can be found as follows"
@harry-cpp
harry-cpp / VSCodeExtension.py
Last active November 17, 2023 16:21
VSCode extension for Nautilus
Moved to:
https://github.com/cra0zy/code-nautilus
since people want to add features to it and no notification arrive from comments on gist.
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active December 3, 2024 21:48
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
@jhit
jhit / letsencrypt-for-pure-ftpd.sh
Last active May 20, 2018 10:05
Taken from: https://www.howtoforge.com/community/threads/securing-ispconfig-3-control-panel-port-8080-with-lets-encrypt-free-ssl.75554/page-4#post-357460. What I'm actually using for pure-ftpd at the moment is the below script, run from a cronjob; rather than testing file timestamps it actually compares the certificate serial number handed out b…
#!/bin/bash
# letsencrypt-for-pure-ftpd.sh: compares the ssl certficate/key used by pure-ftpd
# with the current certificate/key issued by letsencrypt and copy the latter
# to the former if they differ.
# this can be run as a cronjob to propogate letsencrypt certificate changes
# to pure-ftpd
PUREFTPD_CERT=/etc/ssl/private/pure-ftpd.pem
@DragonBe
DragonBe / FinalClass.php
Created July 20, 2017 15:05
Testing final classes is tricky, but possible even though you cannot directly mock a "final" class
<?php
namespace FinalClass;
require_once __DIR__ . '/vendor/autoload.php';
use PHPUnit\Framework\TestCase;
final class Foo
{
protected $bar;
@jniltinho
jniltinho / install_ispconfig_nginx_debian.sh
Last active October 12, 2021 08:14
Install ISPConfig +Nginx on Debian 9 64Bits
#!/bin/bash
## Author: Jose Nilton >> www.linuxpro.com.br
## Install ISPConfig 3 on Debian 9 64Bits
## ISPConfig3 3 + Nginx + Debian 9 64Bits
## VM HD 50GB, swap 2GB, / 20GB, /var/www all
## Filesystem ext4
## Run as root
## Link: https://www.howtoforge.com/tutorial/perfect-server-debian-jessie-nginx-bind-dovecot-ispconfig-3.1/
@LukeFF
LukeFF / iframe.html
Last active September 7, 2016 10:00
automatic Iframe resizing without Cross-Origin issues
<body onLoad="resizeParent();">
<script type="text/javascript">
function resizeParent() {
var height = document.getElementsByTagName("html")[0].scrollHeight;
window.parent.postMessage(["setIframeHeight", height], "*");
}
</script>
</body>
@DragonBe
DragonBe / mikko_test.md
Created August 9, 2016 12:20
Simple test for PHP development skill evaluation (orig. created by Mikko Koppanen)

The assignment (max 1h30): Salary Payment Date tool

This assignment gives us a good understanding about the thought-process and the capabilities of the developer. This doesn’t have to be a rock-solid, highly scalable super fancy production-ready application, but just something that allows us to get an idea of the developer's skills and level.

Try to keep things simple. If frameworks, libraries or databases are needed to write the application, please mention them and the arguments why they were required in the documentation for this assignment.

NOTE: This is a sample code and will only be used for evaluation purposes

Requirements:

@hisnipes
hisnipes / Wordpress GravityForms Google Spreadsheet Hook
Last active December 10, 2021 14:03
Wordpress GravityForms Google Spreadsheet Hook - dynamically populate radio button choices using data from a Google Spreadsheet (should allow for easier collaboration with non-tech colleagues). Matches with today's date to pull relevant information from the table. Thanks to Pamela Fox (parsing JSON output with PHP: https://gist.github.com/pamela…
<?
// Gravity Form Hook to SQL Database for Today's Dishes //
// the ### in gform_pre_render_### locates the id of your form //
add_filter('gform_pre_render_5', 'todays_dishes');
function todays_dishes($form){
foreach($form['fields'] as &$field){
@bcremer
bcremer / README.md
Last active October 12, 2015 12:08
Shopware4 Nginx Configuration - This configuration is WIP!