Skip to content

Instantly share code, notes, and snippets.

{
"bold_folder_labels": true,
"color_scheme": "Packages/User/Flatland Monokai (SL).tmTheme",
"font_face": "Ubuntu Mono",
"font_options": "subpixel_antialias",
"font_size": 14,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
[

Keybase proof

I hereby claim:

  • I am justyns on github.
  • I am justyns (https://keybase.io/justyns) on keybase.
  • I have a public key whose fingerprint is A595 5545 D893 69F2 B144 78C1 905F 2A38 2C08 70B5

To claim this, I am signing this object:

Logstash Performance Testing

Server Details

HP BL460

  • 48 Gb Memory
  • 2 x X5675 @ 3.07GHz
  • 2 x 10 gbps NIC
  • 2tb NetApp NFS volume for ES data
#!/bin/sh
PORT=4200
sudo launchctl unload /Library/LaunchDaemons/com.crashplan.engine.plist
sudo sed -i '' "s/\(<servicePort>\)[^<]*/\1$PORT/" /Library/Application\ Support/CrashPlan/conf/my.service.xml
sed -i '' "s/#*\(servicePort=\).*/\1$PORT/" /Applications/CrashPlan.app/Contents/Resources/Java/conf/ui.properties
defaults write /Applications/CrashPlan.app/Contents/Resources/CrashPlan\ menu\ bar.app/Contents/Info CPPort $PORT
sudo launchctl load /Library/LaunchDaemons/com.crashplan.engine.plist
#!/bin/bash
matches=()
directory='/opt/graphite/storage/whisper'
for file in $(find $directory -type f -name '*.wsp' -print); do
$(python /usr/local/bin/whisper-info.py $file > /dev/null 2>&1)
retval=$?
echo "checking $file"
[ $retval -ne 0 ] && matches+=($file)

If your system vm is not currently working you have to make it work. On XenServer you can do this by SSH'ing to it and upgrade java.

apt-get update && apt-get -y install openjdk-7-jre-headless openjdk-7-jre-lib && apt-get -y remove openjdk-6-jre-headless

and it should now work. In some rare cases you have to restart the cloud service

service cloud stop && sleep 3 && service cloud start

and in some even rarer cases you have to restart the ssvm. Do that from the Apache CloudStack UI.

/etc/init.d/cloud-management stop
mysql -ppassword -e 'drop database cloud'
mysql -ppassword -e 'drop database cloud_usage'
cloud-setup-databases cloud:password@localhost --deploy-as=root:password
rm -rf /var/log/cloud/management/*
cloud-setup-management
/etc/init.d/cloud-management start
@justyns
justyns / simplegoURLShortener.go
Created September 14, 2015 13:26
Simple Go URL Shortener. No persistence, just stores everything in memory.
package main
import (
"fmt"
"net/http"
"strconv"
)
type ShortURL struct {
ID uint64
Options +FollowSymlinks
RewriteEngine on
# No intersticial for direct reference and self-reference
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://box.leebyron.com/.*$ [NC]
# Add a line item for every website you don't need an intersticial for
# I've added my own website, gmail and facebook
RewriteCond %{HTTP_REFERER} !^http(s)?://([^\.]*.)?leebyron.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://mail.google.com/.*$ [NC]