Skip to content

Instantly share code, notes, and snippets.

View theclanks's full-sized avatar

Luis Carlos Otte Junior theclanks

View GitHub Profile
@theclanks
theclanks / .cshrc
Last active December 13, 2015 11:03
FreeBSD Cshrc
# $FreeBSD: release/10.0.0/share/skel/dot.cshrc 243893 2012-12-05 13:56:39Z eadler $
#
# .cshrc - csh resource script, read at beginning of execution by each shell
#
# see also csh(1), environ(7).
# more examples available at /usr/share/examples/csh/
#
alias h history 25
alias j jobs -l
alias la ls -aF
public function echo_memory_usage() {
$mem_usage = memory_get_usage(true);
if ($mem_usage < 1024)
echo $mem_usage." bytes";
elseif ($mem_usage < 1048576)
echo round($mem_usage/1024,2)." kb";
else
echo round($mem_usage/1048576,2)." mb";
echo "".PHP_EOL;
}
To set APM level:
camcontrol cmd ada0 -a "EF 05 00 00 00 00 00 00 00 00 xx 00"
To disable it:
camcontrol cmd ada0 -a "EF 85 00 00 00 00 00 00 00 00 00 00
To set AAM level:
camcontrol cmd ada0 -a "EF 42 00 00 00 00 00 00 00 00 xx 00"
To disable it:
camcontrol cmd ada0 -a "EF C2 00 00 00 00 00 00 00 00 00 00
@theclanks
theclanks / build.sh
Last active August 29, 2015 14:06 — forked from NicolasT/build.sh
#!/bin/bash -ue
# Dependencies (list might be incomplete):
# src/libevent-2.0.21-stable.tar.gz
# src/libsearpc (I used git f022c6509cff2eb604024c003eb60bcda975c0b1)
# src/ccnet (with Nicolas' patches, I used 3495a78466add16cfa9eddfb35a312bb9ce55264)
# src/seafile (with Nicolas' patches, I used 59eb918655dfa5f1328ec72be00681c6192f523d)
#
# Toolchain:
# vala (vala-0.18.1-1.fc18.x86_64)
@theclanks
theclanks / seamake.sh
Last active June 6, 2017 06:50
seafile client build
#!/usr/bin/env bash
yum install vala vala-compat wget gcc libevent-devel openssl-devel gtk2-devel libuuid-devel sqlite-devel jansson-devel intltool cmake qt-devel fuse-devel
echo "Building and installing seafile client"
export version=4.2.8 # change this to your preferred version
alias wget='wget --content-disposition -nc'
wget https://github.com/haiwen/libsearpc/archive/v3.0.2.tar.gz
wget https://github.com/haiwen/ccnet/archive/v${version}.tar.gz
Criar Branch:
mkdir branches/2.14.0
svn add branches/2.14.0
svn cp trunk/projeto branches/2.14.0/projeto
cd branches/
svn commit -m "Branch criada"
svn up
Merge do trunk para a branches com uma revisao:
@theclanks
theclanks / sel_custom_firefox.txt
Created November 26, 2014 18:10
Selenium - Webdriver Custom Firefox
wget https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/25.0/linux-i686/en-US/
profile = webdriver.FirefoxProfile("/compat/linux/opt/firefox/firefox-bin")
self.driver = webdriver.Firefox(profile)
.cshrc
setenv UNAME_v "FreeBSD 8.3-RELEASE #0: Sat Nov 29 11:15:09 BRST 2014 root@bsd:/usr/obj/usr/src/sys/GENERIC"
setenv UNAME_r 8.3-RELEASE
setenv PACKAGESITE "ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8-stable/Latest/"
pkg_add -r bmake
cp /usr/bin/make /usr/bin/make.old
rm /usr/bin/make
ln -sv /usr/local/bin/bmake /usr/bin/make
@theclanks
theclanks / ssl_curl
Created January 21, 2015 11:48
SSL curl
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
or if it fails:
command curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
@theclanks
theclanks / timeseries.txt
Created October 14, 2015 21:31
time series link
http://stackoverflow.com/questions/26290314/r-calculate-a-count-of-items-over-time-using-start-and-end-dates
https://books.google.com.br/books?id=hFbSBQAAQBAJ&pg=PA188&lpg=PA188&dq=r+time+series++duration&source=bl&ots=pP2acGIQqc&sig=jo6m67G2SMR3dLhYsJ9yjVe9hjs&hl=pt-BR&sa=X&redir_esc=y#v=onepage&q=r%20time%20series%20%20duration&f=false
http://stackoverflow.com/questions/31583944/decompose-xts-hourly-time-series/31586363#31586363
http://stackoverflow.com/questions/17156143/how-to-create-a-r-timeseries-for-hourly-data
https://rpubs.com/hrbrmstr/time-series-machinations
http://stats.stackexchange.com/questions/120806/frequency-value-for-seconds-minutes-intervals-data-in-r
http://www.statmethods.net/advstats/timeseries.html