Skip to content

Instantly share code, notes, and snippets.

@zined
zined / percona.syslog
Created December 20, 2012 18:12
percona-server-server-5.5 installation error on a fresh squeeze installation
Dec 20 17:59:32 ip-10-246-121-195 mysqld_safe[8839]:
Dec 20 17:59:32 ip-10-246-121-195 mysqld_safe[8839]: PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
Dec 20 17:59:32 ip-10-246-121-195 mysqld_safe[8839]: To do so, start the server, then issue the following commands:
Dec 20 17:59:32 ip-10-246-121-195 mysqld_safe[8839]:
Dec 20 17:59:32 ip-10-246-121-195 mysqld_safe[8839]: /usr/bin/mysqladmin -u root password 'new-password'
Dec 20 17:59:32 ip-10-246-121-195 mysqld_safe[8839]: /usr/bin/mysqladmin -u root -h ip-10-246-121-195 password 'new-password'
Dec 20 17:59:32 ip-10-246-121-195 mysqld_safe[8839]:
Dec 20 17:59:32 ip-10-246-121-195 mysqld_safe[8839]: Alternatively you can run:
Dec 20 17:59:32 ip-10-246-121-195 mysqld_safe[8839]: /usr/bin/mysql_secure_installation
Dec 20 17:59:32 ip-10-246-121-195 mysqld_safe[8839]:
@zined
zined / ugly.js
Created December 10, 2012 15:55
ugly ugly :)
var https = require('https');
var tuples = new Array(
Math.floor(Math.random(254)*100),
Math.floor(Math.random(254)*100),
Math.floor(Math.random(254)*100),
Math.floor(Math.random(254)*100));
var ip = tuples.join('.');
var MAX_URLS = 30;
@zined
zined / gist:4136410
Created November 23, 2012 16:37
reverse / tail_reverse
-module(mylist).
-export([tail_reverse/1, tail_reverse/2, reverse/1]).
reverse([]) -> [];
reverse([H|T]) -> reverse(T)++[H].
tail_reverse(L) -> tail_reverse(L, []).
tail_reverse([], Accumulator) -> Accumulator;
tail_reverse([H|T], Accumulator) -> tail_reverse(T, [H|Accumulator]).
@zined
zined / gist:4135279
Created November 23, 2012 11:51
any minute cfengine3 class definition?
classes:
"MinAny" or => {
"Min00", "Min01", "Min03", "Min04", "Min05", "Min06", "Min07", "Min08", "Min09",
"Min10", "Min11", "Min13", "Min14", "Min15", "Min16", "Min17", "Min18", "Min19",
"Min20", "Min21", "Min23", "Min24", "Min25", "Min26", "Min27", "Min28", "Min29",
"Min30", "Min31", "Min33", "Min34", "Min35", "Min36", "Min37", "Min38", "Min39",
"Min40", "Min41", "Min43", "Min44", "Min45", "Min46", "Min47", "Min48", "Min49",
"Min50", "Min51", "Min53", "Min54", "Min55", "Min56", "Min57", "Min58", "Min59",
};
@zined
zined / gist:3995952
Created November 1, 2012 19:41
bluetooth works great
[root@horst ~]# while (true); do hidd --search ; sleep 1; done
Searching ...
Connecting to device B8:F6:B1:0C:CE:1C
Can't get device information: Connection reset by peer
Searching ...
Connecting to device B8:F6:B1:0C:CE:1C
Can't get device information: Transport endpoint is not connected
Searching ...
Connecting to device B8:F6:B1:0C:CE:1C
Can't get device information: Transport endpoint is not connected
@zined
zined / cfengine_test_1.cf
Created October 30, 2012 17:08
cfengine test snippet #1
bundle edit_line that_foo_line_be_gone
{
replace_patterns:
"^foo is a foo line$"
comment => "that foo line be gone! that bar line be there!",
replace_with => exchange_foo_line_with_bar_line;
}
body replace_with exchange_foo_line_with_bar_line
{
@zined
zined / hex_no_nulls.php
Created September 23, 2012 15:35
padded, reversed, hex strings without nulls
#!/usr/bin/php
<?php
function ascii_hex ($char) {
$ret = '';
for ($i=0;$i<strlen($char);++$i)
$ret .= dechex(ord($char{$i}));
if (strlen($ret) < 2) return '0'.$ret;
return $ret;
}