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 / FreeBSD_confs.txt
Created December 13, 2015 10:59
FreeBSD Configs
/boot/loader.conf:
zfs_load="YES"
cuse4bsd_load="YES"
kern.ipc.shmmax=67108864
kern.ipc.shmall=32768
kern.ipc.shmmni=1024
kern.ipc.shmseg=1024
Random file 1G
<SAMSUNG HD322HJ 1AC01118> ATA-7 SATA 2.x device
150.000MB/s transfers (SATA, UDMA5, PIO 8192bytes)
outside: 102400 kbytes in 0.854841 sec = 119788 kbytes/sec
ZFS escrita - 26.233768 segs
ZFS leitura MD5 - 14 segs
UFS escrita - 50 segs
@theclanks
theclanks / nnet_plot_update.r
Created June 12, 2018 18:52 — forked from fawda123/nnet_plot_update.r
nnet_plot_update
plot.nnet<-function(mod.in,nid=T,all.out=T,all.in=T,bias=T,wts.only=F,rel.rsc=5,
circle.cex=5,node.labs=T,var.labs=T,x.lab=NULL,y.lab=NULL,
line.stag=NULL,struct=NULL,cex.val=1,alpha.val=1,
circle.col='lightblue',pos.col='black',neg.col='grey',
bord.col='lightblue', max.sp = F,...){
require(scales)
#sanity checks
if('mlp' %in% class(mod.in)) warning('Bias layer not applicable for rsnns object')
@theclanks
theclanks / pandas_memory_reduction.py
Created August 5, 2020 14:48
Reducing pandas memory usage
## Function to reduce the DF size
def reduce_mem_usage(df, verbose=True):
numerics = ['int16', 'int32', 'int64', 'float16', 'float32', 'float64']
start_mem = df.memory_usage().sum() / 1024**2
for col in df.columns:
col_type = df[col].dtypes
if col_type in numerics:
c_min = df[col].min()
c_max = df[col].max()
if str(col_type)[:3] == 'int':
@theclanks
theclanks / gcloud-port-forward.md
Created June 2, 2022 03:51 — forked from jibs/gcloud-port-forward.md
port forwarding with a google cloud instance

Google cloud's ssh command lets you pass standard ssh flags. To, for example, forward local port 8088 to port 8088 on a vm instance, all you need to do is:

gcloud compute  ssh --ssh-flag="-L 8088:localhost:8088"  --zone "us-central1-b" "example_instance_name"

Now browsing to localhost:8088 works as it would with standard ssh.