Skip to content

Instantly share code, notes, and snippets.

View feliperomero3's full-sized avatar

Felipe Romero feliperomero3

View GitHub Profile
@feliperomero3
feliperomero3 / curl-commands.sh
Last active March 22, 2023 05:21
Curl commands
#!/bin/bash
# Only output headers
curl -vs https://example.com > /dev/null
@feliperomero3
feliperomero3 / sqlite3.cmd
Last active August 6, 2022 21:54
Sqlite3 CLI commands
REM Export table to CSV file
sqlite3 -header -csv "backup 2022-03-14 173525.mdb" "SELECT * FROM transactions" > "transactions.csv"
REM Get schema information
sqlite3 -header -csv "backup 2022-03-14 173525.mdb" "PRAGMA table_info(transactions)"
REM Do this to enter Sqlite "REPL" or "interactive" mode (exit with .exit)
sqlite3 "backup 2022-03-14 173525.mdb"
@feliperomero3
feliperomero3 / index.html
Created May 25, 2022 23:23
HTML: Simple Maintenance Page
<!doctype html>
<html>
<head>
<title>Site Maintenance</title>
<meta charset="utf-8"/>
<meta name="robots" content="noindex"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body { text-align: center; padding: 20px; font: 20px Helvetica, sans-serif; color: #efe8e8; }
@media (min-width: 768px){
@feliperomero3
feliperomero3 / chocolatey-packages.ps1
Last active April 20, 2024 01:25
PowerShell Snippets
choco install tcping
choco install git.install
choco install gh
choco install jq
choco install less
choco install tree
choco install postman
choco install speedtest
choco install openssl
choco install openssl.light
@feliperomero3
feliperomero3 / ftp-client-centos.sh
Last active March 27, 2021 23:31
FTP Client: CentOS
# Source: https://www.server-world.info/en/note?os=CentOS_7&p=ftp&f=2
# [1] Install FTP Client.
[root@dlp ~]# yum -y install lftp
# [2] The connection with root account is prohibited by default, so access with an common user to FTP Server.
# lftp [option] [hostname]
[redhat@dlp ~]$ lftp -u cent www.srv.world
@feliperomero3
feliperomero3 / README.md
Last active June 3, 2023 19:28
Generate a self-signed certificate using OpenSSL

Generate a self-signed root certificate using OpenSSL

This repository contains a script that will generate a trusted ssl certificate which can be used for local software development.

Prerequisites

  • OpenSSL.
  • Bash (Linux only).
  • Git Bash (Windows only).
@feliperomero3
feliperomero3 / powershell-azure-keyvault.ps1
Last active November 6, 2022 23:22
PowerShell Az Module snippets
# This command gets the certificate named TestCert01 from the key vault named ContosoKV01.
# To download the certificate as pfx file, run following command.
# These commands access SecretId and then save the content as a pfx file.
$cert = Get-AzKeyVaultCertificate -VaultName "ContosoKV01" -Name "TestCert01"
$secret = Get-AzKeyVaultSecret -VaultName $vaultName -Name $cert.Name -AsPlainText
$secretByte = [Convert]::FromBase64String($secret)
$x509Cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($secretByte, "", "Exportable,PersistKeySet")
$type = [System.Security.Cryptography.X509Certificates.X509ContentType]::Pfx
$pfxFileByte = $x509Cert.Export($type, $password)
@feliperomero3
feliperomero3 / Deploy-AzureResourceGroup.ps1
Created January 18, 2020 03:55 — forked from cweining/Deploy-AzureResourceGroup.ps1
Shows how to upgrade Visual Studio Azure Resource Group deployment scripts to support new versions of Azure Powershell modules.
#Requires -Version 3.0
Param(
[string] [Parameter(Mandatory=$true)] $ResourceGroupLocation,
[string] $ResourceGroupName = 'AzureResourceGroup3',
[switch] $UploadArtifacts,
[string] $StorageAccountName,
[string] $StorageContainerName = $ResourceGroupName.ToLowerInvariant() + '-stageartifacts',
[string] $TemplateFile = 'WebSite.json',
[string] $TemplateParametersFile = 'WebSite.parameters.json',
@feliperomero3
feliperomero3 / apache-ubuntu.sh
Created July 26, 2019 21:59
Apache on Ubuntu 18.04
# https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-ubuntu-18-04
# Check with the systemd init system to make sure the service is running by typing:
sudo systemctl status apache2
# To stop your web server, type:
sudo systemctl stop apache2
# To start the web server when it is stopped
sudo systemctl start apache2
@feliperomero3
feliperomero3 / wp-aligns.css
Last active March 1, 2019 03:40
WordPress standard classes to align an image element
/* Source: https://github.com/aldolat/posts-in-sidebar/wiki/Usage#getting-posts-from-multiple-post-types */
.alignleft {
float: left;
margin-right: 10px;
}
.alignright {
float: right;
margin-left: 10px;