Skip to content

Instantly share code, notes, and snippets.

View mirez's full-sized avatar

Alberto Ramirez mirez

View GitHub Profile
@mirez
mirez / install_hp_printer_drivers.sh
Last active September 24, 2023 19:16 — forked from garry-jeromson/install_hp_printer_drivers.sh
Install HP printer drivers on macOS 13.4 Ventura
#!/bin/bash
curl -o ~/Downloads/hpdrivers.dmg https://updates.cdn-apple.com/2020/macos/001-41745-20201210-DBC9B46B-88B2-4032-87D9-449AF1D20804/HewlettPackardPrinterDrivers.dmg
hdiutil attach ~/Downloads/hpdrivers.dmg
pkgutil --expand /Volumes/HP_PrinterSupportManual/HewlettPackardPrinterDrivers.pkg ~/Downloads/hp-expand
hdiutil eject /Volumes/HP_PrinterSupportManual
FROM public.ecr.aws/lambda/dotnet:5.0
#You can alternately also pull these images from DockerHub amazon/aws-lambda-dotnet:5.0
# Copy function code
COPY net5-lambda-template/bin/Debug/net5.0 ${LAMBDA_TASK_ROOT}
# Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile)
CMD [ "net5-lambda-template::net5_lambda_template.LambdaFunction::Handler" ]
@mirez
mirez / GIF-Screencast-OSX.md
Created October 29, 2019 16:58 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@mirez
mirez / palindromePrime.hs
Created January 5, 2019 22:36
returns true if the integer is prime and a palindrome
divides d n = rem n d == 0
ldf k n | divides k n = k
| k^2 > n = n
| otherwise = ldf (k+1) n
ld n = ldf 2 n
prime0 n | n < 1 = error "not a positive integer"
| n == 1 = False
@mirez
mirez / Microsoft.Powershell_profile.ps1
Created December 27, 2018 17:39
Powershell to modify prompt to show CWD and append Git repo and branch when applicable to current directory
function prompt {
$gitstatus = "`r`n » $(pwd)";
$pwd = (pwd);
try {
$gitbranch = (git rev-parse --abbrev-ref HEAD);
$repo = ((git rev-parse --show-toplevel) -split "/") | Select-Object -Last 1
if( -not [string]::IsNullOrEmpty("$gitbranch") ) {
@mirez
mirez / Microsoft.Powershell_profile.ps1
Created December 27, 2018 17:36
Powershell to kill a windows process by the local port it is using
function Stop-PortOwningProcess {
param(
[Parameter(Mandatory, Position=0)]
[int] $localPort )
try{
$netpids = Get-NetTCPConnection | Where-Object{ $_.LocalPort -eq $localPort }
$toBeKilled = Get-Process | Where-Object { $_.Id -eq $netpids[0].OwningProcess }
$toBeKilled
<appender name="GraphiteUdpAppender" type="log4net.Appender.UdpAppender">
<remoteAddress value="graphiteserver.somewhere.com"/>
<remotePort value="8125"/>
<layout type="log4net.Layout.PatternLayout">
<IgnoresException value="False"/>
<conversionPattern value="%property{log4net:HostName}.log4net.%level:1|kv\n"/>
</layout>
</appender>
<!-- Remember to add the appender to the root
@mirez
mirez / redis.conf
Created September 25, 2014 20:05
LRU Redis Configuration
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
var page = require('webpage').create();
page.viewportSize = { width : 1024, height: 768 };
page.open('http://breakingnews.com', function () {
setTimeout(function(){
page.render('f:\\screenshots\\breakingnews.com.png');
phantom.exit();
}, 1500);
});
@mirez
mirez / nj-counties.topojson
Last active December 22, 2015 11:58
topoJSON
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.