Skip to content

Instantly share code, notes, and snippets.

@ndrut
ndrut / gist:8475401
Created January 17, 2014 15:35
EPELRPM install nodejs 32-bit Centos6
[root@nodetest ~]# yum install http://mirror.compevo.com/epel/6/i386/epel-release-6-8.noarch.rpm
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: mirror.trouble-free.net
* extras: centos.someimage.com
* updates: mirror.atlanticmetro.net
base | 3.7 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 1.3 MB 00:00
[root@git awd]# npm install lodash
npm http GET https://registry.npmjs.org/lodash
npm http 200 https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz
npm http 200 https://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz
[email protected] node_modules/lodash
[root@git awd]# vim checklodash.js
[root@git awd]# node checklodash.js
[root@git awd]# cat checklodash.js
var lodash = require('lodash');
[ jedi ] tail # npm install tail
npm WARN package.json [email protected] No repository field.
npm http GET https://registry.npmjs.org/tail
npm http 200 https://registry.npmjs.org/tail
npm http GET https://registry.npmjs.org/tail/-/tail-0.3.5.tgz
npm http 200 https://registry.npmjs.org/tail/-/tail-0.3.5.tgz
[email protected] ../node_modules/tail
[ jedi ] tail # touch logfile
[ jedi ] tail # vim tail.js
[ jedi ] tail # node tail.js &
@ndrut
ndrut / gist:8405259
Created January 13, 2014 18:17
npm 1.1.4 w/ node 0.6.12
* symlink /home/socket/.nave/installed/0.6.12/bin/npm (-> ../lib/node_modules/npm/bin/npm-cli.js)
* installing out/Release/node as /home/socket/.nave/installed/0.6.12/bin/node
* installing out/Release/src/node_config.h as /home/socket/.nave/installed/0.6.12/include/node/node_config.h
Waf: Leaving directory `/home/socket/.nave/src/0.6.12/out'
'install' finished successfully (3.333s)
using 0.6.12
[socket@jedi test]$ node -v
v0.6.12
[socket@jedi test]$ npm -v
1.1.4
@ndrut
ndrut / gist:8367478
Created January 11, 2014 05:35
fuck comcast
To google.com 11:17 PM on 1/10:
My traceroute [v0.83]
desktop.tyne.io (0.0.0.0) Fri Jan 10 23:17:04 2014
Keys: Help Display mode Restart statistics Order of fields quit
Packets Pings
Host Loss% Snt Last Avg Best Wrst StDev
1. 192.168.1.1 0.0% 302 0.4 0.4 0.4 12.8 0.8
2. 73.209.216.1 7.0% 302 7.2 9.5 3.5 41.9 5.0
3. xe-4-0-0-32767-sur01.bearcreek.t 9.3% 302 7.7 12.6 6.5 91.8 12.6
4. ae-15-0-ar04.bearcreek.tx.housto 8.6% 302 8.4 10.8 3.1 45.3 6.0
@ndrut
ndrut / gist:8341701
Created January 9, 2014 20:47
nginx config for gitlab
# GITLAB
# Maintainer: @randx
# App Version: 5.0
upstream gitlab {
server unix:/home/git/gitlab/tmp/sockets/gitlab.socket;
}
server {
listen *:80 default_server; # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea
@ndrut
ndrut / gist:8036152
Created December 19, 2013 08:31
fglrx bad
[pid 2217] 02:28:06.415642 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 <0.000031>
[pid 2217] 02:28:06.415775 setrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0 <0.000030>
[pid 2217] 02:28:06.415921 execve("/usr/lib64/qt-3.3/bin/ln", ["ln", "-s", ".././libfglrx_ip.a"], ["AMDAPPSDKROOT=/opt/AMDAPP", "SHELL=/bin/bash", "_=/bin/make", "HISTCONTROL=ignoredups", "QT_PLUGIN_PATH=/usr/lib64/kde4/p"..., "LESSOPEN=||/usr/bin/lesspipe.sh "..., "MAIL=/var/spool/mail/root", "PATH=/usr/lib64/qt-3.3/bin:/usr/"..., "QT_GRAPHICSSYSTEM_CHECKED=1", "XDG_RUNTIME_DIR=/run/user/1000", "LS_COLORS=rs=0:di=01;34:ln=01;36"..., "KDEDIRS=/usr", "MODFLAGS=-DMODULE -DATI -DFGL -D"..., "PWD=/usr/lib/modules/fglrx/build"..., "HOME=/root", "LD_LIBRARY_PATH=:/opt/AMDAPP/lib"..., "LOGNAME=root", "HOSTNAME=desktop.tyne.io", "SSH_ASKPASS=/usr/libexec/openssh"..., "SHLVL=2", "CC=gcc-4.0", "MAKEOVERRIDES=${-*-command-varia"..., "XDG_SESSION_ID=2", "USER=root", "PAGE_ATTR_FIX=0", "OLDPWD=/lib/modules/fglrx/build_"..., "
@ndrut
ndrut / pull.js
Last active December 20, 2015 08:18
Cheerio and Request, used to scrape posts from a vBulletin forum.
request({ 'url': url, 'headers': headers, 'jar': true } , function (err, resp, body){
if (err) throw err;
$ = cheerio.load(body);
$('table[id^="post"]').each(function(i,elem) {
id = $(elem).attr('id').match(/[0-9]+$/)[0];
author = $(elem).find('div[id^="postmenu_"]').find('a.bigusername').text().trim();
subject = $(elem).find('td[id^="td_post_"] div.smallfont strong').text().trim();
postbody = $(elem).find('td[id^="td_post_"] div[id^="post_message_"]').text().trim();
strdate = $(elem).find('div.normal').text().trim().split("\t").pop();
[root@phoenix tmp]# /usr/local/apache/bin/ab -n 100 -c 100 http://127.0.0.1:9292/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient).....done
Server Software:
Server Hostname: 127.0.0.1
[root@phoenix ~]# wget -O /dev/null http://nodejs.org/dist/v0.10.13/node-v0.10.13.tar.gz
--2013-07-23 13:16:23-- http://nodejs.org/dist/v0.10.13/node-v0.10.13.tar.gz
Resolving nodejs.org... 165.225.133.150
Connecting to nodejs.org|165.225.133.150|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 13373879 (13M) [application/octet-stream]
Saving to: “/dev/null”
100%[======================================================================================================================================================================================================================================>] 13,373,879 6.36M/s in 2.0s