Skip to content

Instantly share code, notes, and snippets.

View erseco's full-sized avatar
💭
dG9udG8gZWwgcXVlIGxvIGxlYQ==

Ernesto Serrano erseco

💭
dG9udG8gZWwgcXVlIGxvIGxlYQ==
View GitHub Profile
@Munawwar
Munawwar / ExcelReading.java
Last active November 2, 2022 08:37
Java - Apache POI - Convert XLS/XLSX to CSV
/*
* Dependencies: Apache POI Library from http://poi.apache.org/
*/
package poi_excels;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.logging.Level;
/******************************************************************************
*
* 2015 - Ernesto Serrano <info@ernesto.es>
* ---------------------------------------------
*
* Fichero auxiliar para pintar colores en la consola
*
******************************************************************************/
#ifndef __Color_h__
@jodiecunningham
jodiecunningham / awscheck.sh
Created August 9, 2015 15:04
AWS Startup on-demand script
#!/bin/sh
# Install the AWS CLI, set up an IAM user for the instance(s) you want to control.
# Pull the AWS keys for the IAM user and run aws configure to add them.
# I run this on Sophos UTM and have Sophos run a reverse proxy from the \
# $ROUTERIP:32400 to $PLEXHOST:32400
# set -x
# started with screen -Sdm a '/root/bin/awscheck.sh'een -Sdm a '/root/bin/awscheck.sh'screen -Sdm a '/root/bin/awscheck.sh'screen -Sdm a '/root/bin/awscheck.sh'n -Sdm a '/root/bin/awscheck.sh'
PLEXHOST=dokie.duckdns.org
WANIF=eth2
@jodiecunningham
jodiecunningham / idle.sh
Created August 9, 2015 15:13
Shut down idle AWS plex instance
#!/bin/bash
#set -x
#DEBUG=echo
# Runs via cron to shut down the instance if it's not in use for 5 minutes
# Starts checks after it's been up more than 500secs
# Won't kick you out if you're ssh'ed in and it's idle.
# crontab -l|grep idle
# */6 * * * * /root/bin/idle.sh >/dev/null 2>&1
until $(awk '$1>500{exit 1}' /proc/uptime)
@DocX
DocX / README.md
Last active September 5, 2023 12:58
Connect to bash inside running ECS container by cluster and service name
FROM python:2.7-alpine
MAINTAINER Nick Janetakis <nick.janetakis@gmail.com>
ENV INSTALL_PATH /bsawf
RUN mkdir -p $INSTALL_PATH
WORKDIR $INSTALL_PATH
COPY requirements.txt requirements.txt
RUN apk add --no-cache --virtual .build-deps \
@justincbagley
justincbagley / How_to_Convert_Markdown_to_PDF.md
Last active June 14, 2024 22:42
How To Convert Markdown to PDF

How to convert markdown to PDF:

This post reviews several methods for converting a Markdown (.md) formatted file to PDF, from UNIX or Linux machines.

Using Pandoc:

$ pandoc How_I_got_svg-resizer_working_on_Mac_OSX.md -s -o test1.pdf
@utek
utek / wildcard-ssl-certificate.md
Created August 31, 2018 06:25 — forked from talyguryn/wildcard-ssl-certificate.md
How to get a wildcard ssl certificate and set up Nginx.

Request a new certificate

Get certbot

Go to any directory and clone repo with sources.

cd ~
git clone https://github.com/certbot/certbot
@zaqmor
zaqmor / powershell-reverse-text-file-lines.txt
Last active March 23, 2021 09:37
Powershell: Reverse text file lines
$x = Get-Content -Path .\the\path.txt; Set-Content -Path .\the\path.txt -Value ($x[($x.Length-1)..0])