Skip to content

Instantly share code, notes, and snippets.

@sincere32
sincere32 / haproxy.cfg
Created May 10, 2023 08:15 — forked from jriguera/haproxy.cfg
Haproxy for Multimaster MySQL cluster
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
# to have these messages end up in /var/log/haproxy.log you will
# need to:
#
# 1) configure syslog to accept network log events. This is done
# by adding the '-r' option to the SYSLOGD_OPTIONS in
# /etc/sysconfig/syslog
@sincere32
sincere32 / SpeedTest.py
Created January 18, 2020 04:34 — forked from Axel-Erfurt/SpeedTest.py
GUI for speedtest-cli (PyQt5)
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#############################################################################
import csv, codecs, time, os
import matplotlib.pyplot as plt; plt.rcdefaults()
import numpy as np
from PyQt5.QtCore import (QFile, QFileInfo, QPoint, QRect, QSettings, QSize,
Qt, QTextStream, QProcess, QDir)
from PyQt5.QtGui import QIcon, QFont
from PyQt5.QtWidgets import (QAction, QApplication, QMainWindow,
@sincere32
sincere32 / gmaps_3.html
Created August 9, 2019 20:03 — forked from opnchaudhary/gmaps_3.html
Get latitude and longitude from google maps
<!doctyp html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Get Latitude and Longitude</title>
<script src="http://maps.google.com/maps/api/js?libraries=places&region=uk&language=en&sensor=true"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
</head>
<body>
@sincere32
sincere32 / gmaps_v3_integration.html
Created August 9, 2019 20:02 — forked from opnchaudhary/gmaps_v3_integration.html
Integrate Google maps 3 in website
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Maps</title>
<style>
#map_canvas {
width: 500px;
height: 400px;
}
@sincere32
sincere32 / convert2timeago.php
Created October 28, 2018 11:57 — forked from hubsgz/convert2timeago.php
转换时间戳为n天/小时/分/秒前
<?php
/**
* 转换时间戳为n天/小时/分/秒前
*
* @param unknown $timestamp 时间戳
*
* @return string
*/
function convert2timeago($timestamp)
{
@sincere32
sincere32 / functions.sh
Created September 11, 2016 18:23 — forked from luginbash/functions.sh
Dynamic DNS endpoint IP address update script with Mikrotik router
#!/bin/bash
function snmpGetIP
{
local SNMP_HOST=$1
local SNMP_COMM=$2
local SNMP_IFID=$3
snmpwalk -Os -c ${SNMP_COMM} -v 2c ${SNMP_HOST} ipAdEntIf | grep "INTEGER: ${SNMP_IFID}" | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'
}