Skip to content

Instantly share code, notes, and snippets.

View acataluddi's full-sized avatar

Adriano C. acataluddi

View GitHub Profile
@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
$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