Skip to content

Instantly share code, notes, and snippets.

View favrik's full-sized avatar
🏀

Favio Manriquez favrik

🏀
View GitHub Profile
@favrik
favrik / Vagrantfile
Created September 16, 2012 07:06
Chess.com Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "chessdev"
config.vm.guest = :freebsd
config.vm.box_url = "http://images.chesscomfiles-4.com/images/package.box"
config.vm.network :hostonly, "10.10.10.10"
[2012-09-17 14:16:24] request.ERROR: Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "POST http://secure.c.com/cookieSetter.php" (uncaught exception) at /www/dev/sites/www.c.com/chess/Application/ChessBundle/Event/RouterListener.php line 23 [] {"file":"/www/dev/sites/www.c.com/chess/Application/ChessMonologBundle/Logger.php","line":52,"class":"Application\ChessMonologBundle\Logger","function":"addRecord","requestGetVariables":[],"requestPostVariables":{"banned":"undefined","optionalParam":"undefined"},"sessionData":[],"url":"/cookieSetter.php","ip":"127.0.0.1","http_method":"POST","server":"secure.c.com","referrer":"https://secure.c.com/checkUser.swf"}
@favrik
favrik / vagrant.org
Created October 18, 2012 06:42
CentOS Box for Vagrant
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00002abb2551a8b1, pid=4299, tid=1105414464
#
# JRE version: 6.0_37-b06
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.12-b01 mixed mode linux-amd64 )
# Problematic frame:
# V [libjvm.so+0x87a8b1] YieldingFlexibleWorkGang::start_task(YieldingFlexibleGangTask*)+0x11
#
[root@localhost bin]# gdb /usr/bin/java core.4368
GNU gdb (GDB) CentOS (7.0.1-42.el5.centos.1)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
2012.11.13-12:10:03.839: ERROR - Cannot start JettyStatisticsLogger. Statistics Handler MBean is not initialized. Please check Jetty configuration!
2012.11.13-12:10:03.844: INFO - JettyStatisticsLogger enabled: autoLogging=true, started=true
2012.11.13-12:10:05.053: WARN - Could not start CMSOldGenerationManager
java.lang.IllegalStateException: Could not find MemoryPoolMXBean with name CMS Old Gen
at com.chess.live.server.monitoring.CMSOldGenerationManager$Manageable.start(CMSOldGenerationManager.java:57)
at com.chess.live.server.DemoChessServlet.init(DemoChessServlet.java:263)
at com.chess.live.AbstractChessServlet.init(AbstractChessServlet.java:87)
at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:477)
at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:293)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
2012.11.13-14:47:30.548: WARN - CpuUsageLogger: avgCpuTime=227 threadCount=59
2012.11.13-14:47:30.550: WARN - CpuUsageLogger: THREAD 14 CPU 0.0 BLOCKED
sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:136)
org.eclipse.jetty.server.nio.SelectChannelConnector.accept(SelectChannelConnector.java:109)
org.eclipse.jetty.server.AbstractConnector$Acceptor.run(AbstractConnector.java:938)
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
java.lang.Thread.run(Thread.java:662)
---
THREAD 17 CPU 0.0 BLOCKED
@favrik
favrik / gist:4527816
Created January 14, 2013 04:43
Playing with d3. ^_^
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
@favrik
favrik / vim-regex.md
Created March 6, 2013 11:09
Replace string with another string at same indentation level

Input

                  =r.text_field :first_name
                .control-group
                  =r.label :middle_name, "Middle Name", class: "control-label"

Output

@favrik
favrik / gist:5492724
Created April 30, 2013 23:34
Replazor of strings
find . -type f -print0 | xargs -0 sed -i 's/->err(/->error(/g'
find . -type f -print0 | xargs -0 sed -i 's/->warn(/->warning(/g'