Skip to content

Instantly share code, notes, and snippets.

View kristapsk's full-sized avatar

Kristaps Kaupe kristapsk

View GitHub Profile
--- ../hhvm/hphp/runtime/ext/ext_network.cpp 2013-11-26 14:42:19.630297106 +0200
+++ ext_network.cpp 2013-11-26 15:40:24.176773807 +0200
@@ -100,28 +100,14 @@
IMPLEMENT_THREAD_LOCAL(ResolverInit, ResolverInit::s_res);
Variant f_gethostname() {
- struct addrinfo hints, *res;
- char h_name[NI_MAXHOST];
- int error;
- String canon_hname;

The binary on the website is capable only to decode encrypted data, not encode, and may contain trojan (seems like it doesn't, but don't believe me). The binary is signed with the valid (usual) key. All old versions are wiped, the repository is wiped too.


Assumption #1 The website is presumed hacked, the keys are presumed compromised. Please do not download or run it. And please don't switch to bitlocker.

Latest working version is 7.1a. Version 7.2 is a hoax

On the SourceForge, the keys were changed before any TrueCrypt files uploaded, but now they are deleted and the old keys got reverted back.

#! /bin/bash
#
# backup_redmine.sh
# modified by ronan@lespolypodes.com
# Inspiration: https://gist.github.com/gabrielkfr/6432185
#
# Distributed under terms of the MIT license.
# -- VARS
DAY=`date +"%Y%m%d"`
@kristapsk
kristapsk / date_loop.sh
Created March 14, 2016 14:45
Bash date loop
#! /bin/bash
date_start="2015-01-01"
date_end="2015-12-31"
date_start_unixtime="`date --date="$date_start" +"%s"`"
date_end_unixtime="`date --date="$date_end" +"%s"`"
date_current=$date_start
date_current_unixtime=$date_start_unixtime
diff --git a/hphp/runtime/ext/mysql/mysql_common.cpp b/hphp/runtime/ext/mysql/mysql_common.cpp
index 4ab1d17..a4947b0 100644
--- a/hphp/runtime/ext/mysql/mysql_common.cpp
+++ b/hphp/runtime/ext/mysql/mysql_common.cpp
@@ -48,7 +48,7 @@
#include "hphp/runtime/ext/std/ext_std_network.h"
#include "hphp/runtime/server/server-stats.h"
-#include "hphp/runtime/ext/async_mysql/ext_async_mysql.h"
+//#include "hphp/runtime/ext/async_mysql/ext_async_mysql.h"
@kristapsk
kristapsk / hhvm-fullUrl.patch
Created November 23, 2016 16:19
HHVM fullUrl patch for ServerStats
diff --git a/hphp/runtime/server/http-request-handler.cpp b/hphp/runtime/server/http-request-handler.cpp
index 4b5c3f4..8369e8e 100644
--- a/hphp/runtime/server/http-request-handler.cpp
+++ b/hphp/runtime/server/http-request-handler.cpp
@@ -180,8 +180,7 @@ void HttpRequestHandler::handleRequest(Transport *transport) {
}
}
- ServerStats::StartRequest(transport->getCommand().c_str(),
- transport->getRemoteHost(),
<?php
$algo = 'sha512';
$algo_iter = 100;
$rand = ord(openssl_random_pseudo_bytes(1));
$pass = 'password';
$salt = openssl_random_pseudo_bytes(16);
$salt_hex = bin2hex($salt);
$finished = false;
$val = hash($algo, hash($algo, $pass) . $salt);
for ($i = 0; $i <= 255; $i++) {

Keybase proof

I hereby claim:

  • I am kristapsk on github.
  • I am kristapsk (https://keybase.io/kristapsk) on keybase.
  • I have a public key ASBHmqoD_9bKZ-aOHjBP4NPx_q1EtPBCbxvBWUmDSK-9sgo

To claim this, I am signing this object:

@kristapsk
kristapsk / odroid-hc4-raspibolt-notes.md
Last active December 2, 2021 00:58
Odroid HC4 RaspiBolt installation notes

Odroid HC4 RaspiBolt installation notes

Upgrading

Upgrading kernel will make it unbootable.

# apt update
# apt-mark hold linux-odroid-c4
linux-odroid-c4 set on hold.
#!/usr/bin/env bash
while :; do
lightning-cli listpeers | jq -r ".peers[].id" | while read node_id; do
if [[ $((RANDOM % 2)) != 0 ]]; then
echo "Pinging $node_id"
lightning-cli ping $node_id $((RANDOM % 65530)) $((RANDOM % 65530))
fi
done
echo "[$(date -u +"%Y-%m-%dT%H:%M:%SZ")] sleeping..."