Skip to content

Instantly share code, notes, and snippets.

@touhonoob
touhonoob / Ranking.php
Created June 13, 2012 09:39
Reddit Ranking Algorithms in PHP
<?php
/**
* Ranking Library
* contains alogrithms for story ranking
* Basically a PHP Implementation of reddits algorithms
*
* @author Lucas Nolte <[email protected]>
* @since 0.1
* @package Polska Wiadomosc
* @subpackage Libraries
@alexfu
alexfu / FragmentObserver.java
Last active June 21, 2024 19:11
Observer pattern for notifying Fragments of a ViewPager to update their views. This will update the current Fragment, as well as the off screen Fragments that are retained.
public class FragmentObserver extends Observable {
@Override
public void notifyObservers() {
setChanged(); // Set the changed flag to true, otherwise observers won't be notified.
super.notifyObservers();
}
}
@Aldaviva
Aldaviva / Linux VPN server.md
Last active January 30, 2023 10:42
OpenVPN client and server configuration with bridging

OpenVPN server configuration for a Linux server like a Raspberry Pi

Prerequisites

  • Linux (tested on Raspbian 10 Buster and 11 Bullseye)
  • OpenVPN (tested on 2.4.7-1 and 2.5.1-3 from apt)
  • bridge-utils (tested on 1.6-2 and 1.7-1 from apt)

Ethernet configuration

/etc/network/interfaces

@vallettea
vallettea / sftp.md
Created March 21, 2016 14:33
How to setup a secure ftp server on ubuntu.

Setting up ftp server on ubuntu

Install

apt-get install vsftpd openssh-server

Configure ftp

@rnjailamba
rnjailamba / solrMysqlSetup.md
Last active March 16, 2024 14:10
Solr + Mysql + Data Import Handler + Delta Import Handler [ Version 5.5.0 of solr ]
@danielpereirabp
danielpereirabp / nginx-proxy
Created June 22, 2018 19:19
Nginx Proxy - SPA (Vue 2) + API/ADMIN (Laravel 5.6)
server {
listen 80;
server_name domain.com.br;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8181;
@wido
wido / mkteslaemmcimg.sh
Last active October 11, 2024 19:28
Tesla Model S/X MCU1 eMMC image creator
#!/bin/bash
#
# Create a 8GB eMMC image for Tesla Model S/X MCU1
#
# Example usage: ./mkteslaemmcimg.sh ./vinXXXXX.img ./develop-2019.20.2.1-16-5659e07dfd.img
#
set -e
FIRMWARE=$2
IMAGE=$1
@appleguru
appleguru / mkteslaemmcimg.sh
Last active October 11, 2024 19:28 — forked from wido/mkteslaemmcimg.sh
Tesla Model S/X MCU1 eMMC image creator
#!/bin/bash
#
# Create a 8GB eMMC image for Tesla Model S/X MCU1
#
# Example usage: ./mkteslaemmcimg.sh ./vinXXXXX.img ./develop-2019.20.2.1-16-5659e07dfd.img
#
set -e
FIRMWARE=$2
IMAGE=$1