Skip to content

Instantly share code, notes, and snippets.

@mepunit
mepunit / free_mem_avr
Created October 19, 2012 14:56
Get Free SRAM available in AVR
extern void __bss_end;
extern void *__brkval;
int get_free_memory()
{
int free_memory;
if((int)__brkval == 0)
free_memory = ((int)&free_memory) - ((int)&__bss_end);
else
{
"title": "Magento performance",
"services": {
"query": {
"list": {
"0": {
"query": "*",
"alias": "",
"color": "#7EB26D",
"id": 0,
@mepunit
mepunit / ip_blacklist.lua
Created July 13, 2018 07:20 — forked from chrisboulton/ip_blacklist.lua
Redis based IP blacklist for Nginx (LUA)
-- a quick LUA access script for nginx to check IP addresses against an
-- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403.
--
-- allows for a common blacklist to be shared between a bunch of nginx
-- web servers using a remote redis instance. lookups are cached for a
-- configurable period of time.
--
-- block an ip:
-- redis-cli SADD ip_blacklist 10.1.1.1
-- remove an ip:
@mepunit
mepunit / wordpress-firebase.php
Created August 21, 2018 06:36 — forked from derekconjar/wordpress-firebase.php
An example of using Firebase and WordPress together. The idea is to use WP's custom post types and metaboxes to make content management easy, and sync with Firebase so that your websites have access to a real-time JSON feed of your custom data.
<?php
/**
* All custom functions should be defined in this class
* and tied to WP hooks/filters w/in the constructor method
*/
class Custom_Functions {
// Custom metaboxes and fields configuration
@mepunit
mepunit / Nginx-minio-static.md
Created September 3, 2018 20:37 — forked from harshavardhana/nginx-minio-static.md
How to configure nginx+minio static website?

Ubuntu 16.04

  1. Install nginx
  2. Install minio
  3. Install mc client
  4. Create a bucket:
$ mc mb myminio/static
Bucket created successfully ‘myminio/static’.
@mepunit
mepunit / OpenVPNInstallUbuntu1604
Created November 2, 2018 04:08 — forked from cyrex562/OpenVPNInstallUbuntu1604
Install OpenVPN stable latest on Ubuntu 16.04 using the OpenVPN.net official APT repository.
wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg|apt-key add -
echo "deb http://build.openvpn.net/debian/openvpn/stable xenial main" > /etc/apt/sources.list.d/openvpn-aptrepo.list
apt -y update && apt -y install openvpn easy-rsa