Skip to content

Instantly share code, notes, and snippets.

View ricardosaracino's full-sized avatar

Ricardo Saracino ricardosaracino

View GitHub Profile
@lesstif
lesstif / HMacTest.java
Last active February 27, 2024 07:10
HMAC SHA256 example java code
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
public class HMacTest {
public static final String ALGORITHM = "HmacSHA256";
public static String calculateHMac(String key, String data) throws Exception {
Mac sha256_HMAC = Mac.getInstance(ALGORITHM);
@Hakky54
Hakky54 / openssl_commands.md
Last active May 3, 2024 03:14 — forked from p3t3r67x0/openssl_commands.md
Some list of openssl commands for check and verify your keys

OpenSSL 🔐

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@xiaol825
xiaol825 / install.txt
Last active October 17, 2023 02:37 — forked from ziadoz/install.sh
How to install Chrome, ChromeDriver and Selenium on CentOS. Plus a sample scraping script.
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@mikemunsie
mikemunsie / phoneMasks.json
Last active April 29, 2024 17:19
Phone Masks by Country Code JSON
{
"AC": "+247-####",
"AD": "+376-###-###",
"AE": "+971-5#-###-####",
"AE": "+971-#-###-####",
"AF": "+93-##-###-####",
"AG": "+1(268)###-####",
"AI": "+1(264)###-####",
"AL": "+355(###)###-###",
"AM": "+374-##-###-###",
@Yousha
Yousha / .gitignore
Last active May 1, 2024 04:55
.gitignore for PHP developers.
##### Windows
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
@goyalmohit
goyalmohit / configure-ssl-for-jenkins-on-centos.sh
Last active February 29, 2024 22:36
Configure SSL for Jenkins on CentOS
#This gist is related to blog post https://mohitgoyal.co/2017/02/08/securing-your-jenkins-environment-and-configure-for-auditing/
# Generate certificate csr
openssl req -new > new.ssl.csr
# Create a key file for generating certificate
openssl rsa -in privkey.pem -out new.cert.key
# Create a csr file using the key file for 635 days
openssl x509 -in new.ssl.csr -out new.cert.cert -req -signkey new.cert.key -days 365
@ricardosaracino
ricardosaracino / chromebox.md
Created June 30, 2016 14:10
Hacking an ASUS chromebox

ASUS makes a pretty handy Chromebox, and it's handy not just because it's running ChromeOS, it's handy because of everything you can do to the box itself.

The ASUS Chromebox is easily upgradeable, and capable of running just about any linux distribution.

The model I picked up, the M004U has the following specs:

  • Celeron 2955U (1.4GHz) 64 bit Dual core processor with 2MB L3 Cache
  • 2GB DDR3 1600 RAM with 2 slots
  • 16GB SSD HDD
  • 802.11 b/g/n dual-band wireless, Bluetooth 4.0, and gigabit ethernet
@ereli
ereli / gist:a0faf53e417403df8863
Created April 9, 2015 10:15
prevent screensaver and workstation lockout - vbs script that presses the numlock key twice every 10 seconds
# ref: http://superuser.com/a/836346
Dim objResult
Set objShell = WScript.CreateObject("WScript.Shell")
i = 0
Do While i = 0
objResult = objShell.sendkeys("{NUMLOCK}{NUMLOCK}")
Wscript.Sleep (10000)
@mrshridhara
mrshridhara / MessageLoggingHandler.cs
Created July 7, 2014 13:44
DelegatingHandler to log request and response of a Web API call.
using System;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
/// <summary>
/// </summary>
public class MessageLoggingHandler : DelegatingHandler
{
@mumumu
mumumu / ImageRotateUtil.java
Last active April 8, 2022 11:03
Automatically corrects the orientation of image by interpreting exif:Orientation value. This class depends on JMagick and apache-sanselan.
package org.mumumu.test;
import java.io.ByteArrayOutputStream;
import magick.ImageInfo;
import magick.MagickImage;
import org.apache.sanselan.Sanselan;
import org.apache.sanselan.common.IImageMetadata;
import org.apache.sanselan.formats.jpeg.JpegImageMetadata;