Skip to content

Instantly share code, notes, and snippets.

View EdwardNavarro's full-sized avatar
🎯
Focusing

Edward Navarro EdwardNavarro

🎯
Focusing
View GitHub Profile
@jdiaz5513
jdiaz5513 / ascii_arty.py
Last active December 30, 2023 02:32
Console ASCII Art Generator
#! /usr/bin/env python2
# Requires: PIL, colormath
#
# Improved algorithm now automatically crops the image and uses much
# better color matching
from PIL import Image, ImageChops
from colormath.color_conversions import convert_color
from colormath.color_objects import LabColor
from colormath.color_objects import sRGBColor as RGBColor
<?php
class TransformerAbstract
{
private $fields;
private $allowedFields = array('id', 'name', 'phone', 'email', 'bio', 'num_friends');
private $partialFields = array(
'id' => array('id', 'name'),
'info' => array('name', 'phone', 'email', 'bio'),
'bio' => array('bio')
@m1r0
m1r0 / wp_insert_attachment_from_url.php
Last active April 11, 2024 12:33
WP: Insert attachment from URL
<?php
/**
* Insert an attachment from a URL address.
*
* @param string $url The URL address.
* @param int|null $parent_post_id The parent post ID (Optional).
* @return int|false The attachment ID on success. False on failure.
*/
function wp_insert_attachment_from_url( $url, $parent_post_id = null ) {
@laurenarcher
laurenarcher / livestreamingyoutube
Created November 21, 2014 14:13
Livestreaming to Youtube Live, Ubuntu, Linux FFMPEG
Terminal Commands:
One webcam:
ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -vcodec libx264 -pix_fmt yuv420p -preset ultrafast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE
Two webcam overlay:
ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -f v4l2 -s 320x240 -r 10 -i /dev/video0 -filter_complex "[1:v]setpts=PTS-STARTPTS[bg]; [2:v]setpts=PTS-STARTPTS[fg]; [bg][fg]overlay=shortest=1 [out]" -map "[out]" -map 0:a -vcodec libx264 -pix_fmt yuv420p -preset veryfast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE
@francis2110
francis2110 / LG infrared codes
Created January 22, 2015 10:01
Lg infrared codes for making your own remote
on-off->20DF10EF
energy->20DFA956
av. mode->20DF0CF3
input->20DFD02F
tv/rad->20DF0FF0
1->20DF8877
2->20DF48B7
3->20DFC837
4->20DF28D7
5->20DFA857
@ageis
ageis / openpgp-card-guide.md
Last active December 11, 2023 09:36
Quick GPG Smartcard Guide
@TrimIdeas
TrimIdeas / Audit changed or deleted files in Windows Server 2008 R2 or newer.ps1
Last active March 27, 2023 04:45
Audit changed and deleted files on Server 2008 R2, 2012, and 2012 R2
# Version 1.2 :: This script reads offline event logs, oldest to newest, bottom to top.
# See http://www.trimideas.com/2015/04/auditing-changed-deleted-files.html for instructions.
$LogPath = "C:\Event_Logs\"
$ReportPath = "C:\Audit\File-Audit-Reports\"
$Formatted_Date = (Get-Date -UFormat %A-%B-%d-at-%I-%M-%S%p)
$ZipName = "Security-Events-for-" + (Get-Date -UFormat %A-%B-%d) + ".zip"
$Report_in_CSV = $ReportPath + "Audit of changed files on " + $Formatted_Date + ".csv"
$Truncated_Log_Path = $LogPath + "Archive-Security_on_" + $Formatted_Date + ".evtx"
$Today_Midnight = (Get-Date -Hour 0 -Minute 0 -Second 0)
@yuraloginoff
yuraloginoff / html5 audio queue
Last active July 25, 2022 05:55
html5 audio queue
<!doctype html>
<html>
<head>
<script>
//This plays a file, and call a callback once it completed (if a callback is set)
function play(audio, callback) {
audio.play();
if (callback) {
@gerard-kanters
gerard-kanters / inactivity.js
Last active March 6, 2024 18:49
Inactivity timeout javascript
<script type="text/javascript">
function idleTimer() {
var t;
//window.onload = resetTimer;
window.onmousemove = resetTimer; // catches mouse movements
window.onmousedown = resetTimer; // catches mouse movements
window.onclick = resetTimer; // catches mouse clicks
window.onscroll = resetTimer; // catches scrolling
window.onkeypress = resetTimer; //catches keyboard actions
@mc2pw
mc2pw / setting-up-keys-on-tails.md
Last active October 22, 2023 02:32
Setting up Keys on Tails

In a previous post I introduced the Tails operating system, and listed some steps for getting started. I lay out here some steps for configuring SSH and getting started with GPG.

SSH

Go to the .ssh directory and create a private key (identity file) and public key pair.

$ cd ~/.ssh
$ ssh-keygen -t rsa -b 4096 -C "<email>"