Skip to content

Instantly share code, notes, and snippets.

View carlosh93's full-sized avatar

Carlos Hinojosa carlosh93

View GitHub Profile
@carlosh93
carlosh93 / hq_video2gif.sh
Created September 17, 2021 06:29
Convert MP4 to GIF with high quality #ffmpeg #video #bash
# Install ffmpeg and gifski ( https://github.com/ImageOptim/gifski)
ffmpeg -i intro_vid.mp4 frame%04d.png
gifski -o clip.gif frame*.png
@carlosh93
carlosh93 / tmuxsc
Last active January 27, 2021 19:17
Tmux commands #bash
# start a new session
tmux new -s geek-1
#detach session
ctrl + b + d
#list sessions
tmux ls
#attach to a session
@carlosh93
carlosh93 / sshvpn.sh
Last active January 26, 2021 14:07
VPN over SSH
# You can create ssh connection with dynamic port forwarding to create socks proxy:
ssh -D 9050 user@sshserver -fTNC
# -D [bind_address:]port Specifies a local “dynamic” application-level port forwarding... Whenever a connection is made to this port, the connection is forwarded over the secure channel, and the application protocol is then used to determine where to connect to from the remote machine. Currently the SOCKS4 and SOCKS5 protocols are supported
# The options -fTNC will enable the compression and will push the connection in the background.
# Optionally use autossh instead of ssh
@carlosh93
carlosh93 / crop_remove_audio.sh
Created November 22, 2020 04:38
Crop video and remove audio #ffmpeg
ffmpeg -ss 00:00:15.00 -i "OUTPUT-OF-FIRST URL" -t 00:00:10.00 -map 0 -map -0:a -c copy out.mp4
@carlosh93
carlosh93 / delete_commit.sh
Last active August 19, 2020 16:37 — forked from dsci/gist:1347672
Delete commits from git repository #git #bash #linux #github
# First, check out the commit you wish to go back to (get sha-1 from git log)
git reset --hard 9d3c3a0caa7f7b35ef15adb96fc80fcbb59ac72a
# Then do a forced update.
git push origin +9d3c3a0caa7f7b35ef15adb96fc80fcbb59ac72a^:develop
# Push specific commit
git push origin 9d3c3a0caa7f7b35ef15adb96fc80fcbb59ac72a:develop -f
@carlosh93
carlosh93 / HSI_classification.m
Last active July 13, 2020 15:30
HSI Classification #matlab
% Se carga la data
load('Salinas_corrected.mat');
load('Salinas_gt.mat');
Fullimg = salinas_corrected;
Fullimg = Fullimg(:,1:216,:);
data_lbls = salinas_gt(:,1:216);
clear salinas_corrected salinas_gt
Nm = 216;
Mm = 512;
Lh = 204;
@carlosh93
carlosh93 / gist:7b08822ec408b925e955fd827eb86363
Last active December 16, 2020 19:53
Sublime Text 3 license key 2020 Updated and working perfectly
----- BEGIN LICENSE -----
Member J2TeaM
Single User License
EA7E-1011316
D7DA350E 1B8B0760 972F8B60 F3E64036
B9B4E234 F356F38F 0AD1E3B7 0E9C5FAD
FA0A2ABE 25F65BD8 D51458E5 3923CE80
87428428 79079A01 AA69F319 A1AF29A4
A684C2DC 0B1583D4 19CBD290 217618CD
5653E0A0 BACE3948 BB2EE45E 422D2C87
@carlosh93
carlosh93 / TF_load_images.py
Last active November 1, 2022 09:31
Tensorflow Load Images in Dataset #python #tensorflow
# https://www.tensorflow.org/tutorials/load_data/images
import tensorflow as tf
AUTOTUNE = tf.data.experimental.AUTOTUNE
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
import os
import pathlib
data_dir = tf.keras.utils.get_file(origin='https://storage.googleapis.com/download.tensorflow.org/example_images/flower_photos.tgz',
@carlosh93
carlosh93 / file_to_array.py
Last active June 7, 2020 23:12
Read file lines and save in array #python #basics #python.io
class_names = [c.strip() for c in open(FLAGS.classes).readlines()]