Skip to content

Instantly share code, notes, and snippets.

sudo apt install apt-transport-https
sudo sh -c 'echo "deb http://www.apache.org/dist/cassandra/debian 40x main" > /etc/apt/sources.list.d/cassandra.list'
wget -q -O - https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -
sudo apt update
sudo apt install cassandra
sudo systemctl status cassandra
import os
from PIL import Image
base_path = ""
setp = 5
for i in range(1750000, 1750983, step):
path_img1 = os.path.join(base_path, "Data" + str(i) + ".png")
path_img2 = os.path.join(base_path, "Data" + str(i+step) + ".png")
image1 = Image.open(path_img1)
@rozanecm
rozanecm / ga
Last active February 17, 2023 19:26
commit command. Usage: First, move file to /usr/local/bin. Then, "gc" cmd will be available, to which you should pass the git commit msg.
# git add all files and amend to last commit, leaving no message behind and pushing to upstream branch.
git add . && git commit --amend --no-edit && git push --force-with-lease
DROP TABLE IF EXISTS mediciones;
CREATE TABLE mediciones(
uuid INTEGER NOT NULL
,cod_estacion INTEGER NOT NULL
,variable VARCHAR(4) NOT NULL
,fecha DATE NOT NULL
,valor INTEGER NOT NULL
);
INSERT INTO mediciones(uuid,cod_estacion,variable,fecha,valor) VALUES (1,1,'temp','2020-02-01',14);
INSERT INTO mediciones(uuid,cod_estacion,variable,fecha,valor) VALUES (2,2,'temp','2020-07-01',13);
@rozanecm
rozanecm / http.go
Last active February 22, 2021 14:11
Go http
package main
import (
"encoding/json"
"log"
"net/http"
)
func initHttpServer() {
http.HandleFunc("/statusCheck", statusCheckHandler)
@rozanecm
rozanecm / print_src.sh
Last active May 24, 2020 04:28
Make sure all lines are <80! This gist will generate pdfs for all .cpp and .h files in src/. A pdf per file will be stored in "print output/". All pdfs will be merged to one final file "final_print.pdf".
# print all .cpp and .h files
for f in $(find src/ -name '*.cpp' -or -name '*.h')
do
echo "Processing $f..."
a2ps --line-numbers=1 "$f" -o "$f".ps
done
mkdir "print output"
#for f in src/*.ps
@rozanecm
rozanecm / mp4_to_mp3_320k.sh
Created April 13, 2020 17:12
Extract mp3 320k from mp4 video.
for i in *.mp4; do ffmpeg -i "$i" -b:a 320k -vn "${i%.*}.mp3"; done
@rozanecm
rozanecm / Free Springer Books - eBook list.csv
Created April 9, 2020 00:25
Download script for all free Springer books offered during Covid 2020 qurantine.
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 22 columns, instead of 18. in line 2.
Book Title,Author,Edition,Product Type,Copyright Year,Copyright Holder,Print ISBN,Electronic ISBN,Language,Language Collection,eBook Package,English Package Name,German Package Name,Series Print ISSN,Series Electronic ISSN,Series Title,Volume Number,DOI URL,OpenURL,Subject Classification,Publisher,Imprint
Social Anxiety and Social Phobia in Youth,Christopher Kearney,2005,Graduate/advanced undergraduate textbook,2005,Springer-Verlag US,978-0-387-22591-3,978-0-387-22592-0,EN,English/International,11640,Behavioral Science,,,,Series in Anxiety and Related Disorders,,http://doi.org/10.1007/b99417,http://link.springer.com/openurl?genre=book&isbn=978-0-387-22592-0,Psychology; Clinical Psychology; Personality and Social Psychology; Community and Environmental Psychology,Springer US,Springer
Clinical Neuroanatomy,"John Mendoza, Anne Foundas",2008,Graduate/advanced undergraduate textbook,2008,Springer-Verlag New York,978-0-387-36600-5,978-0-387-36601-2,EN,English/International,11640,Behavioral Science,,,,,,http://doi.o
@rozanecm
rozanecm / 0 ml useful gists
Last active October 31, 2019 14:25
Pipeline blueprint to have fast access to creating ml models.
.
@rozanecm
rozanecm / Exploratory analysis helpful functions
Last active September 2, 2019 17:37
Some useful functions for when performing exploratory analysis with pandas.
Empty file for title purpose only.