Skip to content

Instantly share code, notes, and snippets.

View wnasich's full-sized avatar

Walter Nasich wnasich

  • Rosario, Santa Fe, Argentina
View GitHub Profile
@jeanfbrito
jeanfbrito / influxdb.lua
Created January 6, 2016 18:41
NodeMCU and InfluxDB
-- Your access point's SSID and password
local SSID = "greenhouse"
local SSID_PASSWORD = "senhasupersecreta"
local DEVICE = "device001"
local temperature = 27.5
-- configure ESP as a station
wifi.setmode(wifi.STATION)
wifi.sta.config(SSID,SSID_PASSWORD)
wifi.sta.autoconnect(1)
@evert0n
evert0n / react-app-s3-sync.sh
Created June 11, 2019 11:47 — forked from kevindice/react-app-s3-sync.sh
A shell script for uploading a React app build to S3 + CloudFront for deployment
#!/bin/bash
S3_BUCKET_NAME=$1
CF_ID=$2
# Sync all files except for service-worker and index
echo "Uploading files to $S3_BUCKET_NAME..."
aws s3 sync build s3://$S3_BUCKET_NAME/ \
--acl public-read \
--exclude service-worker.js \
@paul91
paul91 / pecl-memcached.sh
Created May 5, 2014 14:33
How to install php memcached on CentOS 6.5
#!/bin/bash
# How to install PHP memcached on CentOS 6.5
# Install dependencies
yum install cyrus-sasl-devel zlib-devel gcc-c++
# Get the latest libmemcached
wget https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz
tar -xvf libmemcached-1.0.16.tar.gz
@dizz
dizz / gist:2888334
Created June 7, 2012 11:37
enable ip forwarding
sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/' /etc/sysctl.conf
sysctl -p
@lavoiesl
lavoiesl / wordpress-change-url.php
Last active December 8, 2022 12:09
PHP script to replace site url in Wordpress database dump, even with WPML
#!/usr/bin/env php
<?php
/**
* PHP script to replace site url in Wordpress database dump, even with WPML
* @link https://gist.github.com/lavoiesl/2227920
*/
if (!empty($argv[1]) && $argv[1] == 'update') {
$file = file_get_contents('https://gist.github.com/lavoiesl/2227920/raw/wordpress-change-url.php');
if ($file === false) {
@Ciantic
Ciantic / example-typeorm-jest.test.ts
Created April 16, 2019 17:50
Example of testing TypeOrm with Jest and Sqlite in-memory database
import { createConnection, getConnection, Entity, getRepository } from "typeorm";
import { PrimaryGeneratedColumn, Column } from "typeorm";
@Entity()
export class MyEntity {
@PrimaryGeneratedColumn()
id?: number;
@Column()
name?: string;
@mvadu
mvadu / grafana custom.ini
Last active November 11, 2023 18:26
nginx config for using grafana, Influxdb via reverse proxy with authentication
# The full public facing url
#root_url = %(protocol)s://%(domain)s:%(http_port)s/
root_url = http://localhost:80/grafana/
@t-io
t-io / xvfb_screen_recording.py
Created November 17, 2017 10:34
ScreenRecording xvfb
from selenium import webdriver
import sys, getopt, time, subprocess, shlex
from xvfbwrapper import Xvfb
def run():
print('Sreencast website animation')
xvfb = Xvfb(width=1280, height=720, colordepth=24)
xvfb.start()
@KurtJacobson
KurtJacobson / touchscreen_calibration.md
Last active February 27, 2024 22:06
Touchscreen calibration procedue for Debian9 (stretch)

Touchscreen Calibration in Debian9

Unfortunately [xinput-calibrator][1] does not work at all for calibrating a touchscreen in Debian9. This is apparently because X server now uses libinput to handle input devices instead of evdev. I spent huge amount of trying to fiddling with xinput-calibrator and 99-calibration.conf files until I finely found this [issue][2] on GitHub that gave me some hints as how to proceed. This is mostly for my own reference, but I hope it might also help others in the same situation.

@crisidev
crisidev / grafana-dashboard-exporter
Created October 7, 2015 20:35
Command to export all grafana 2 dashboard to JSON using curl
KEY=XXXXXXXXXXXX
HOST="https://metrics.crisidev.org"
mkdir -p dashboards && for dash in $(curl -k -H "Authorization: Bearer $KEY" $HOST/api/search\?query\=\& |tr ']' '\n' |cut -d "," -f 5 |grep slug |cut -d\" -f 4); do
curl -k -H "Authorization: Bearer $KEY" $HOST/api/dashboards/db/$dash > dashboards/$dash.json
done