Skip to content

Instantly share code, notes, and snippets.

View olmosleo's full-sized avatar

Leonardo Olmos Fernandez olmosleo

View GitHub Profile
@olmosleo
olmosleo / check_size_files.sh
Created March 19, 2021 22:03
Dos procedimientos para recorrer archivos en Linux y obtiene el tamaño de cada file en una salida
#!/bin/bash
while IFS= read -r line
do
ls -Ral /var/www/$line | awk '{t+=$5}END{print t}' >> output_file_size.txt
done < lista_files.txt
##!/bin/bash
#while IFS= read -r line
#do
# du -h /var/www/$line >> output_file_size_mb.txt
@olmosleo
olmosleo / fast.sh
Created November 3, 2020 14:14
Test Velocidad (Raspberrypi) fast.sh
#!/bin/bash
# https://sbcguides.com/internet-speed-test-on-raspberry-pi/
# https://github.com/ddo/fast/
wget https://github.com/ddo/fast/releases/download/v0.0.4/fast_linux_arm
sudo install fast_linux_amd64 /usr/local/bin/fast
fast
# -> 123.45 Mbps
@olmosleo
olmosleo / update_api_cvs.py
Created September 23, 2020 17:15
Python Script Read CVS to PUT API REST AUTH_BASIC CALL
import requests
import csv
import json
# Read CSV file
print('[Read] CVS Files')
with open("_NAME_FILE_.csv") as fp:
reader = csv.reader(fp, delimiter=",", quotechar='"')
# next(reader, None) # skip the headers
data_read = [row for row in reader]
@olmosleo
olmosleo / ionic_linux.starter.sh
Last active July 8, 2020 03:59
IONIC Linux Install Standard Config
#!/bin/bash
# Probado en CentOS 7
# Instalacion IONIC Framework
echo "Instalando NodeJS";
sudo yum install -y gcc-c++ make git wget htop
sudo curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash -
sudo yum install -y nodejs
node -v
npm -v
@olmosleo
olmosleo / public_ip.sh
Last active October 3, 2019 18:10
Get Public IP via CURL (command Linux)
#!/bin/bash
curl ifconfig.co
@olmosleo
olmosleo / app.php
Created October 3, 2019 01:17
Rasberry Pi App.php
<!DOCTYPE html>
<html>
<head>
<title>Jquery Apss</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<script>
@olmosleo
olmosleo / default
Created October 3, 2019 01:17
Rasberry pi NGINX /etc/nginx/sites-enabled/default
# You may add here your
# server {
# ...
# }
# statements for each of your virtual hosts to this file
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
@olmosleo
olmosleo / iwconfig_manual.sh
Created October 3, 2019 01:15
Rasberry Pi iwconfig
#!/bin/bash
sudo iwconfig wlan1 mode ad-hoc
sudo iwconfig wlan1 channel 6
sudo iwconfig wlan1 essid "Rasputin"
sudo iwconfig wlan1 key '4566546'
auto lo
auto eth0
@olmosleo
olmosleo / rasberry_history.pi
Created October 3, 2019 01:14
Raspberry History
pi@raspi ~/octopusgen/raspi_config $ history
1 ls
2 top
3 dm
4 dmesg
5 ifconfig
6 iwlist scan
7 iwlist sca
8 iwconfig
9 iwlist scan
@olmosleo
olmosleo / get_public_ip.py
Last active July 12, 2019 16:35
Simple script para obtener IP Publica en Python
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# GET_IP_PUBLIC_PYTHON_SCRIPT_MACOSX
# (Requerimientos) revisar antes de ejecutar:
# $ python --version
# $ pip --version
# $ pip install --user pipenv
# $ python -m site --user-base
# $ echo "export PATH=$PATH:/Users/bash/Library/Python/3.7/bin" >> ~/.bash_profile