Skip to content

Instantly share code, notes, and snippets.

View jacricelli's full-sized avatar

Jorge Alberto Cricelli jacricelli

  • VEMO S.A
  • Zárate, Buenos Aires, Argentina
View GitHub Profile
@jacricelli
jacricelli / wsl-optimize-vhd
Created May 18, 2022 23:56
wsl - reclaim free space
# https://github.com/microsoft/WSL/issues/4699#issuecomment-627133168
#
wsl --shutdown
diskpart
# open window Diskpart
select vdisk file="C:\WSL-Distros\…\ext4.vhdx"
attach vdisk readonly
compact vdisk
detach vdisk
# https://medium.com/geekculture/run-docker-in-windows-10-11-wsl-without-docker-desktop-a2a7eb90556d
#
sudo visudo
# Docker daemon specification
asdf ALL=(ALL) NOPASSWD: /usr/bin/dockerd
echo '# Start Docker daemon automatically when logging in if not running.' >> ~/.bashrc
echo 'RUNNING=`ps aux | grep dockerd | grep -v grep`' >> ~/.bashrc
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",

Starting Postgresql in Windows without Install

Problem

This is a question that comes up quite often by windows users, so thought we would share how we normally do it. The question is

Can you run a PostgreSQL server on your windows desktop/server box without having to install anything?

The answer is

@jacricelli
jacricelli / ttf-vista-fonts-installer.sh
Created November 8, 2021 19:18 — forked from maxwelleite/ttf-vista-fonts-installer.sh
Script to install Microsoft Vista TrueType Fonts (TTF) aka Microsoft’s ClearType fonts on Ubuntu distros
#!/bin/bash
# Author: Maxwel Leite
# Website: http://needforbits.wordpress.com/
# Description: Script to install Microsoft Vista TrueType Fonts (TTF) aka Microsoft’s ClearType fonts on Ubuntu distros
# Microsoft added a group of new "ClearType Fonts" to Windows with Windows Vista and Office 2007.
# These fonts are named Constantia, Corbel, Calibri, Cambria (and Cambria Math), Candara, and Consolas.
# Calibri became the default font on Microsoft Word 2007, and it’s still the default font on Word 2016 today.
# Dependencies: wget, fontforge and cabextract
# Note: Microsoft no longer provides the PowerPoint Viewer 2007 (v12.0.4518.1014) or any version anymore for download
# Tested: Ubuntu Saucy/Trusty/Xenial/Bionic
sudo apt install build-essential linux-headers-amd64
cd Downloads/ #or wherever the .run file was put
sudo chmod +x VirtualBox*.run #previously downloaded from Oracle --> "For all distributions" so does not depend on the problematic libs
sudo ./VirtualBox*.run
vboxversion=$(wget -qO - https://download.virtualbox.org/virtualbox/LATEST.TXT)
wget "https://download.virtualbox.org/virtualbox/${vboxversion}/Oracle_VM_VirtualBox_Extension_Pack-${vboxversion}.vbox-extpack"
sudo vboxmanage extpack install --replace Oracle_VM_VirtualBox_Extension_Pack-${vboxversion}.vbox-extpack
sudo usermod -aG vboxusers [username]
@jacricelli
jacricelli / composer.json
Created April 5, 2021 12:00 — forked from rococodogs/composer.json
cron'd php script to scrape our Ricoh printer's page counts to keep a running tally on our end
{
"require": {
"sunra/php-simple-html-dom-parser": "1.5"
}
}
<?php
/*
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2011 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
<?php
$adServer = "ldap://ip";
$ldap = ldap_connect($adServer);
$username = '';
$password = '';
$ldaprdn = 'DOMAIN' . "\\" . $username;
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);
ldap_set_option($ldap, LDAP_OPT_NETWORK_TIMEOUT, 10);
$bind = ldap_bind($ldap, $ldaprdn, $password);
@jacricelli
jacricelli / forticlientsslvpn-expect.sh
Last active May 31, 2020 23:29 — forked from mgeeky/forticlientsslvpn-expect.sh
Simple script intended to automate Fortinet SSL VPN Client connection on Linux using expect scripting.
#!/bin/bash
# init only
CONNECT_PID=""
RUNNING=""
# Provide required parameters
FORTICLIENT_PATH="/opt/forticlient-sslvpn/64bit/forticlientsslvpn_cli"
VPN_HOST="<HOST:PORT>"
VPN_USER="<USER_NAME>"