Skip to content

Instantly share code, notes, and snippets.

View lumenpink's full-sized avatar
🏠
Starting a fresh project

Lumen Lohn lumenpink

🏠
Starting a fresh project
View GitHub Profile
@lumenpink
lumenpink / knock-agenda
Last active August 29, 2015 14:01
BASH SSH Port Knock Tabajara 2014.1 http://goo.gl/4AgdRM
#!/bin/bash
IP=^^
if who --ips | grep " "${IP}$ >/dev/null
then
###Reagendar
echo reagendar
cat /usr/local/bin/knock-agenda |
sed 's/\^\^/'${IP}'/' |
at `date --date="+2 hours" "+%H:%M %m/%d/%Y"`
else
@lumenpink
lumenpink / knock
Last active September 24, 2020 09:29
Knock 2015.1 - Projeto elaborado na Estácio de Sá Santa Catarina - https://docs.google.com/presentation/d/1G-kDirpN6SyehQw8KUaFqMJARwLrHhw80Y9wdXNNkXQ/edit?usp=sharing
#!/bin/bash
. /usr/local/knock/library
#Lista de portas na ordem da sequencia
ports=(34 1032 43231 456)
#Porta a Ser desbloqueada
safePort=29
#Comando tshark (wireshark para console)
#customizado para exibir apenas
#ip de origem e porta de destino
tshark -n -l -f "tcp and dst 177.70.2.30 and tcp[tcpflags] & (tcp-syn) != 0 and tcp[tcpflags] & (tcp-ack) = 0" -E separator=":" -Tfields -e ip.src -e tcp.dstport |
@lumenpink
lumenpink / index.php
Created May 20, 2016 01:36 — forked from dahlia/index.php
Simple Image Resizing API
<?php
# Simple Image Resizing API
#
# A simple HTTP API for resizing an image (given by the URL).
# This small and dirty ad hoc web application is entirely written in
# PHP 5.3+ with GD. The source code is distributed under Public License.
function is_url($string, $scheme = null) {
$url = parse_url($string);
if (!isset($url['scheme'])) return false;
@lumenpink
lumenpink / setup-cordova-phonegap.ps1
Created June 8, 2016 22:55 — forked from robdmoore/setup-cordova-phonegap.ps1
Scripted/Automated installation script to set up Cordova/PhoneGap and Android on Windows
# Run this in an elevated PowerShell prompt
<# This script worked on a fresh Windows Server 2012 VM in Azure and the following were the latest versions of each package at the time:
* Chocolatey 0.9.8.27
* java.jdk 7.0.60.1
* apache.ant 1.8.4
* android-sdk 22.6.2
* cordova 3.5.0-0.2.6
* nodejs.install 0.10.29
#>
# Note: there is one bit that requires user input (accepting the Android SDK license terms)
@lumenpink
lumenpink / README.md
Created February 1, 2017 17:19 — forked from hubgit/README.md
Remove metadata from a PDF file, using exiftool and qpdf. Note that embedded objects may still contain metadata.

Anonymising PDFs

PDF metadata

Metadata in PDF files can be stored in at least two places:

  • the Info Dictionary, a limited set of key/value pairs
  • XMP packets, which contain RDF statements expressed as XML

PDF files

@lumenpink
lumenpink / mime.sh
Created April 9, 2018 01:44 — forked from markusfisch/mime.sh
bash functions to dump and inspect a message in MIME format
#!/usr/bin/env bash
##############################################################################
#### MIME interface
##############################################################################
# Parse message in MIME format and create a temporary cache directory
mime_parse()
{
MIME_CACHE=${MIME_CACHE:-`mktemp -d ${BIN}.XXXXXXXXXX`}
@lumenpink
lumenpink / mysql2sqlite.sh
Created April 24, 2018 22:02 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@lumenpink
lumenpink / server.js
Created January 18, 2019 04:54 — forked from taion/server.js
GraphQL subscription server with Socket.IO, backed by Redis Pub/Sub
const redisClient = redis.createClient(REDIS_URL);
const listeners = Object.create(null);
function addListener(channel, listener) {
if (!listeners[channel]) {
listeners[channel] = [];
redisClient.subscribe(channel);
}
listeners[channel].push(listener);
/*
* Invokes que submission of the main task form, via a button placed outside the form.
* Also, requests for confirmation after the form validation passes correctly.
* @author: Jonathan Vargas
*/
function triggerTaskFormSubmit ()
{
// Finds required objects
var completeButton = jQuery ('button.btn-task-form')[0];
var mainTaskForm = jQuery('form.main-task-form');
@lumenpink
lumenpink / vue-uppy-input-example
Created May 3, 2019 15:35 — forked from dioniciodiaz/vue-uppy-input-example
Very basic vuejs usage of uppy input file
<template>
<div :id="uppyId">
<div class="uppyFileInput" />
</div>
</template>
<script>
import uppy from "@uppy/core";
import XHRUpload from "@uppy/xhr-upload";
import FileInput from "@uppy/file-input";