Skip to content

Instantly share code, notes, and snippets.

View abarmat's full-sized avatar

Ariel Barmat abarmat

View GitHub Profile
# Create and attach swapfile
sudo fallocate -l 8G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
# Permanent mount
echo "/swapfile none swap sw 0 0" | sudo tee -a /etc/fstab
gpg --symmetric --cipher-algo AES256 file.txt
awk -v RS= '{$1=$1}1'
avconv -y -v warning -i <infile> -ss 00:00:00 -t 00:01:00 -codec copy <outfile>
ffmpeg -i <infile> -c:v libx264 -profile:v high -pix_fmt yuv420p -crf 23 -c:a aac -b:a 160k -strict -2 <outfile>
Web3 = require('web3')
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"))
for file in $(ls -p | sort -R | grep -v / | grep -v s.sh | tail -6000)
do
mv $file ./cv/1/
done
@abarmat
abarmat / add_pub_year.py
Created May 13, 2016 01:42
Datamining UBA Add Publication Years Script
import hashlib
import logging
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
from sklearn import preprocessing
from itertools import groupby
from operator import itemgetter
@abarmat
abarmat / tp2_aa_xgboost_tree.R
Last active May 30, 2017 18:27
DMUBA TP2 AA - Gradient Boosting Tree
library(xgboost)
library(stringr)
preprocess <- function(items) {
# Select features
attr_list = c('anio', 'mes', 'tipoprop', 'lugar', 'sup_tot_m2',
'lat_lon', 'sup_cub_m2', 'piso', 'cant_amb', 'geoname_num', 'Clase')
df <- items[attr_list]
@abarmat
abarmat / j48_random_forest.R
Created June 20, 2016 21:09
DMUBA TP2 AA - Random Forest & J48
setwd("D:/Datamining")
# para eliminar error de java
if (Sys.getenv("JAVA_HOME")!="")
Sys.setenv(JAVA_HOME="")
# paquetes requeridos
if(!require (RWeka)){
install.packages('RWeka')
require (RWeka)