Skip to content

Instantly share code, notes, and snippets.

View acataluddi's full-sized avatar

Adriano C. acataluddi

View GitHub Profile
@acataluddi
acataluddi / fiddle.js
Created September 11, 2020 14:42 — forked from rlmcneary2/fiddle.js
Demonstrate use of jQuery $.ajax with an array of jqXHR Deferred Promise objects passed to the $.when function.
// Seeing this through jsfiddle?
// Get the source from github gist: https://gist.github.com/1873879
// Create an array with two jqXHR objects from two separate $.ajax calls.
var arrJqx = [];
// This call has no delay and the response will come back from the server
// almost immediately.
arrJqx.push($.ajax ({
url: "/echo/json/",
@acataluddi
acataluddi / opt1_template.j2
Created May 6, 2021 15:11 — forked from halberom/opt1_template.j2
ansible - example of template if else
{# style 1 - long form #}
{% if filepath == '/var/opt/tomcat_1' %}
{% set tomcat_value = tomcat_1_value %}
{% else %}
{% set tomcat_value = tomcat_2_value %}
{% endif %}
{# style 2 - short form #}
{% set tomcat_value = tomcat_1_value if (filepath == '/var/opt/tomcat_1') else tomcat_2_value %}
@acataluddi
acataluddi / api.php
Created September 6, 2021 10:09 — forked from pixelbrackets/api.php
Simple PHP script to test and use cURL
<?php
/**
* Simple request response script
*
* Point you cURL request to this script to see all incoming data
*/
echo '*API*'. PHP_EOL;
@acataluddi
acataluddi / README.md
Created November 5, 2022 16:38 — forked from 0x3333/README.md
List mounted points in columns

This is an alias to shells to display mount output in formatted columns.

Add this alias to your rc shell(.bashrc, .zshrc, or whatever):

alias mountc='mount | column -t | sort -V'

Example output:

$ sudo apt-get install cryptsetup # or on redhat - yum install cryptsetup-luks
Reading package lists... Done
Building dependency tree
Reading state information... Done
cryptsetup is already the newest version (2:1.6.6-5ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 63 not upgraded.
$ truncate -s 100m myencryptedcontainer
$ cryptsetup -y -v luksFormat myencryptedcontainer
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Remove Magento's orphan images web console</title>
<link href='https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Inconsolata:400,700&subset=latin,latin-ext' rel='stylesheet'
type='text/css'>
<style type="text/css">
$LogPath = "C:\inetpub\logs\LogFiles\W3SVC1\*"
$LogFiles = "*.log"
[int] $LogRetention = "-30" # in Days
Get-ChildItem $LogPath -Include $LogFiles -Recurse | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays($LogRetention)} | Remove-Item