Skip to content

Instantly share code, notes, and snippets.

View xinuc's full-sized avatar
💭
I may be slow to respond.

Nugroho Herucahyono xinuc

💭
I may be slow to respond.
View GitHub Profile
@xinuc
xinuc / kolosal
Created August 28, 2025 10:00
Error
Running: qwen2.5-coder-0.5b:Q5_0
Type '/exit' or press Ctrl+C to quit
Type '/help' to see available commands
hello
> ❌ Error: Failed to get response from the model. Please try again.
Type your message or use /help for commands...
@xinuc
xinuc / rb
Created May 24, 2017 14:53
prepend.rb
class Hello
def say
puts "hello"
end
end
Hello.new.say
# hello
module HelloPatch
#! /usr/bin/env ruby
str = `passenger-memory-stats | grep "Passenger RubyApp" | grep MB | grep -v 'grep'`
rows = str.split(/\n/)
rows = rows.map {|s| s.gsub(/\s+/, ' ').gsub(/MB Passenger.*/, '').gsub(/ .* MB/, '')}
rows = rows.select{|row| pid, mem = row.split(' '); mem.to_f > 1000 }.map{|row| row.split(' ').first}
rows.each{|pid| puts "kill #{pid}"; `kill #{pid}` }
59bcc3ad6775562f845953cf01624225
@xinuc
xinuc / proxy.sh
Created February 1, 2016 10:14
proxy
#!/bin/sh -e
if [ $# != 3 ]
then
echo "usage: $0 <src-port> <dst-host> <dst-port>"
exit 0
fi
while true; do
TMP=`mktemp -d`
@xinuc
xinuc / mongo.js
Created October 19, 2015 12:31
kill mongodb operation
db.currentOp().inprog.forEach(
function(op) {
if(op.secs_running > 5) printjson(op);
}
)
db.currentOp().inprog.forEach(
function(op) {
if(op.secs_running > 5) db.killOp(op["opid"]);
}
@xinuc
xinuc / pushpin.sh
Last active October 6, 2015 08:17
Pushpin install
sudo apt-get install pkg-config libqt4-dev libqca2-dev \
libqca2-plugin-ossl libqjson-dev libzmq3-dev python-zmq \
python-setproctitle python-jinja2 python-tnetstring \
python-blist mongrel2-core zurl
git clone git://github.com/fanout/pushpin.git
cd pushpin
git submodule init && git submodule update
make
@xinuc
xinuc / proxy.go
Last active August 29, 2015 14:18 — forked from vmihailenco/proxy.go
package main
import (
"flag"
"io"
"log"
"net"
"os"
"os/signal"
"runtime/pprof"
@xinuc
xinuc / indexable.rb
Created January 28, 2014 16:06
indexable
require 'active_support/concern'
module Concerns
module Indexable
class ResultList
include Enumerable
attr_accessor :results
attr_accessor :total
attr_accessor :from
@xinuc
xinuc / potato.rb
Created May 24, 2013 04:48
Potato
class Fixnum
def +(x)
"potato"
end
def *(x)
"potato"
end
def /(x)