Skip to content

Instantly share code, notes, and snippets.

View hayeah's full-sized avatar
🕳️
Focusing

blah blah hayeah

🕳️
Focusing
View GitHub Profile
@hayeah
hayeah / gist:6170397
Created August 7, 2013 01:14
docker test error
2013/08/07 01:11:38 Listening for HTTP on 127.0.0.1:4270 (tcp)
2013/08/07 01:11:46 Container ca3c6649560249e1afb6ab511d28894a4f8f4d3da60cb64b5f378f93e83c2959 failed to exit within 1 seconds of SIGTERM - using the force
2013/08/07 01:11:49 lxc-kill: 'f7624a41c5e0188aa7f0873fb47ae53cfb0df37693fc599a07e145457f6536b5' is not running
lxc-kill: failed to get the init pid
2013/08/07 01:11:49 Failed to send SIGTERM to the process, force killing
2013/08/07 01:11:49 error killing container f7624a41c5e0188aa7f0873fb47ae53cfb0df37693fc599a07e145457f6536b5 (lxc-kill: 'f7624a41c5e0188aa7f0873fb47ae53cfb0df37693fc599a07e145457f6536b5' is not running
lxc-kill: failed to get the init pid
, exit status 255)
2013/08/07 01:11:59 Container f7624a41c5e0188aa7f0873fb47ae53cfb0df37693fc599a07e145457f6536b5 failed to exit within 10 seconds of lxc SIGKILL - trying direct SIGKILL
2013/08/07 01:12:15 error killing container 7afc506d484b7ae8455f523209395e2a6523c9cc52567f3de8416f6028149f84 (lxc-kill: '7afc506d484b7ae8455f523209395e2a6523c
-epoch--- ----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
1375497479| 3 2 49 47 0 0| 16k 24k| 109B 227B| 0 0 | 219 538
1375497480| 3 2 50 46 0 0| 0 2144k| 321B 684B| 0 0 | 272 606
1375497481| 2 0 49 49 0 0| 0 1156k| 110B 98B| 0 0 | 361 827
1375497482| 2 2 49 46 0 0| 0 576k| 224B 617B| 0 0 | 366 752
1375497483| 6 6 44 45 0 0| 0 0 | 23k 449B| 0 0 | 466 797
1375497484| 1 0 50 49 0 0| 0 1548k| 166B 305B| 0 0 | 235 611
1375497485| 1 3 47 49 0 0| 0 1208k| 121B 220B| 0 0 | 296 787
1375497486| 1 0 50 50 0 0| 0 4096B| 117B 225B| 0 0 | 282 602
1375497487| 3 2 46 49 0 0| 0 640k| 119B 221B| 0 0 | 264 591
@hayeah
hayeah / gist:5984309
Created July 12, 2013 13:05
slim jboss deploy
NAMES=$(cat <<HERE
management
hdscanner-jboss-beans.xml
jbossws-console.war
mail-service.xml
mail-ra.rar
http-invoker.sar
admin-console.war
jmx-remoting.sar
jmx-console.war
@hayeah
hayeah / gist:5914730
Created July 3, 2013 01:20
coupon apply error
A NameError occurred in orders#apply_pf_coupon:
uninitialized constant Puffant::Coupon::InvalidCode
app/controllers/puffant/orders_controller.rb:53:in `rescue in apply_pf_coupon'
-------------------------------
Request:
-------------------------------
@hayeah
hayeah / gist:5821472
Last active December 18, 2015 17:49
link images downloaded by exporter into img2
# files = `find /pf/puffant/images/member_photos/ -links 1`.split "n" ; 3
files = Dir["/pf/puffant/images/member_photos/**/*_o.*"]
files.each_slice(1000) do |ff|
link_files(ff)
end
def img_ids(files)
ids = files.map { |file|
name = File.basename(file)
img_id = name.split("_")[0].to_i
@hayeah
hayeah / gist:5552987
Created May 10, 2013 07:41
linked list
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
typedef struct node{
int e;
struct node *next;
} node;
node *list_build(int* a,int size) {
@hayeah
hayeah / sidekiq.rb
Created April 30, 2013 18:50
Starting sidekiq worker process using zeus for faster testing
# adapted from bin/sidekiq
# to invoke, run: zeus runner sidekiq.rb
require 'sidekiq/cli'
begin
cli = Sidekiq::CLI.instance
cli.parse
cli.run
rescue => e
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
typedef struct node{
int e;
struct node *next;
} node;
node *list_build(int* a,int size) {
@hayeah
hayeah / gist:3925801
Created October 21, 2012 04:45
sample nginx rails config
server {
# server_name baolaika.com api.baolaika.com demo.baolaika.com;
server_name pfadmin.baolaika.com;
root /home/deploy/www/puffant-admin/current/public;
location ~ ^/assets/sdk {
access_log off;
gzip_static on;
}
a = (a / 2) - (b / 2)
c = / 2) - (b /