Created from the plain text reference card on orgmode.org Download this file, and open it in Emacs org-mode!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sysbench \ | |
--test=/usr/share/doc/sysbench/tests/db/insert.lua \ | |
--mysql-host=127.0.0.1 \ | |
--mysql-port=3306 \ | |
--mysql-user=sysbench \ | |
--mysql-password=sysbench \ | |
--mysql-db=sysbench \ | |
--mysql-table-engine=innodb \ | |
--oltp-test-mode=complex \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select 'Tcp port: 3306 Unix socket: /tmp/mysql.sock\nTime Id Command Argument' | |
union | |
select concat(date_format(event_time, '%y%m%d %H:%i:%S'), ' ', thread_id, ' ', command_type, '\t', argument) | |
from general_log | |
into outfile '/tmp/test' | |
fields terminated by '' |
These are instructions on getting the simple-todo test app from the meteor tutorial (link below) running on a Mac and using TokuMX instead of MongoDB. It was written in response to this request: https://www.percona.com/blog/2015/05/08/mongodb-percona-tokumxse-experimental-build-rc5-available/#comment-10864682
Prerequsites:
- Install meteor (https://www.meteor.com/install)
- Install boot2docker (http://boot2docker.io/, needed because there currently are no OS/X tokumx binaries)
- Optionally, have mongodb installed on the mac, so you can use the client to connect to tokumx on the container (https://www.mongodb.org/downloads)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var database = "sample"; | |
var collection = "tests"; | |
var connections = []; | |
config = db.getMongo().getDB("config"); | |
config.shards.find().forEach( | |
function (shard,_a,_i) { | |
connections.push(new Mongo(shard["host"])); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
THREADS=3 | |
worker() | |
{ | |
echo "thread $1 starting" | |
sleep 3 | |
rm -f /tmp/lock.$1 | |
echo "thread $1 finished" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EXPLAIN SELECT a.title, a.description AS text, '' AS created, '2' AS browsernav, a.id AS catid, CASE WHEN CHAR_LENGTH(a.alias) != 0 THEN CONCAT_WS(':', a.id, a.alias) ELSE a.id END as slug FROM j_categories AS a WHERE (a.title LIKE '%super%' OR a.description LIKE '%super%') AND a.published IN (1,2) AND a.extension = 'com_content'AND a.access IN (1,1,2,3,6) GROUP BY a.id, a.title, a.description, a.alias ORDER BY a.title DESC LIMIT 0, 50; | |
EXPLAIN SELECT a.name AS title, '' AS created, a.con_position, a.misc, CASE WHEN CHAR_LENGTH(a.alias) != 0 THEN CONCAT_WS(':', a.id, a.alias) ELSE a.id END as slug, CASE WHEN CHAR_LENGTH(c.alias) != 0 THEN CONCAT_WS(':', c.id, c.alias) ELSE c.id END as catslug, CONCAT_WS(',', a.name, a.con_position, a.misc) AS text,CONCAT_WS(' / ', 'Contacts', c.title) AS section,'2' AS browsernav FROM j_contact_details AS a INNER JOIN j_categories AS c ON c.id = a.catid WHERE (a.name LIKE '%super%' OR a.misc LIKE '%super%' OR a.con_position LIKE '%super%' OR a.address LIKE '%super%' OR a.s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cnt=-1 | |
f = nil | |
File.open(ARGV[0]).each_line do |line| | |
if line.match "^TS" | |
f.close unless f.nil? | |
f = File.open(line.gsub(" ","_"), 'w') | |
else | |
f.write(line.gsub(" Info: ","")) if line.match " Info: " and not line.match " Info: NULL" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "java" | |
class Class | |
def atom_attr_accessor(*args) | |
self.class_eval(" | |
require 'clojure.jar' | |
java_import 'clojure.lang.LockingTransaction' | |
java_import 'clojure.lang.Atom' | |
") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- build binary with: | |
-- ghc --make -o hello maintest.hs | |
module Main where | |
main = putStrLn "Hello, world" |