Skip to content

Instantly share code, notes, and snippets.

@molotovbliss
molotovbliss / mysql-mem-report.sh
Last active July 3, 2022 00:56
Generate memory usage report bash script
#!/bin/sh
# Taken from https://dev.mysql.com/doc/refman/5.7/en/memory-use.html
mysql -e "show variables; show status" | awk '
{
VAR[$1]=$2
}
END {
MAX_CONN = VAR["max_connections"]
@yvoronoy
yvoronoy / my.cnf
Last active December 22, 2022 17:57
MySQL Magento Config
[mysqld]
## After edit config you have to remove log files and restart mysql server
## because after changing innodb-log-file-size you should recreate ib_logfiles
## Stop MySQL server
## rm /data/dir/ib_logfile*
## Run MySQL server
##Table open cache under MacOS and MySQL 5.6 should be 250.
##Otherwise you will get error MySQL server has gone away
##table-open-cache = 250
@bench
bench / update-alternatives-golang.sh
Last active November 17, 2024 19:43
update-alternatives golang
#!/bin/bash
#
# Use the following script using sudo to install multiple golang installations on your debian
# update-alternatives creates, removes, maintains and displays information about the symbolic links comprising the alternatives system
# Usage : sudo ./full_golang_install.sh
#
if [[ $(id -u) -ne 0 ]] ; then echo "This script should be run using sudo or as the root user" ; exit 1 ; fi
## Configuration and init
#EXTINF:-1,Nickelodeon
http://B29273.cdn.telefonica.com/29273/NICK_SUB.m3u8
#EXTINF:-1,Disney Junior
http://B29285.cdn.telefonica.com/29285/DSNJR_SUB.m3u8
#EXTINF:-1,40TV
http://B31312.cdn.telefonica.com/31312/40TV_SUB.m3u8
#EXTINF:-1,Disney XD
http://B31309.cdn.telefonica.com/31309/DSNYXD_SUB.m3u8
#EXTINF:-1,Canal Cocina
http://B31305.cdn.telefonica.com/31305/COCINA_SUB.m3u8
@adamgit
adamgit / .gitignore
Last active November 11, 2024 06:14
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
@Heliosmaster
Heliosmaster / simple_sieve.go
Created September 8, 2012 17:27
Simple Erathostenes' Sieve in Go
package main
import (
"fmt"
"os"
"math"
"strconv"
)
func main(){
// figures out which number is the bound
@okaq
okaq / C.go
Created April 20, 2012 13:24
Solution: Recycled Numbers (Google Code Jam 2012 Qualification Round Problem C)
/*
* Google Code Jam 2012 Qualification Round
* Problem C. Recycled Numbers
*/
package main
import (
"bufio"
"bytes"
"flag"
@adam-singer
adam-singer / get_and_unpack.sh
Created January 30, 2012 05:33
Get latest bundle of Dart with Dartium for MacOSX
rm -rf dart snapshots &&
mkdir snapshots &&
cd snapshots &&
wget http://gsdview.appspot.com/dart-editor-archive-continuous/latest/dart-editor-macosx.cocoa.x86_64.zip
cd ../ &&
tar -zxvf snapshots/dart-editor-macosx.cocoa.x86_64.zip &&
cd dart &&
echo "./DartEditor.app/Contents/MacOS/DartEditor" > runDartEditor.sh &&
chmod +x runDartEditor.sh &&
cd dart-sdk &&
@regisbamba
regisbamba / MagentoClient.java
Created February 1, 2011 07:05
example XML-RPC client for Magento API
import redstone.xmlrpc.XmlRpcClient;
import redstone.xmlrpc.XmlRpcException;
import redstone.xmlrpc.XmlRpcFault;
import java.net.MalformedURLException;
import java.util.HashMap;
import redstone.xmlrpc.XmlRpcArray;
import redstone.xmlrpc.XmlRpcStruct;
public class MagentoClient {
@border
border / httpGet.go
Created January 29, 2011 13:30
Http Get Example
package main
import (
"log"
"io/ioutil"
"http"
)
func main() {
res, _, err := http.Get("http://bbs.golang-china.org/")