Skip to content

Instantly share code, notes, and snippets.

View allexiusw's full-sized avatar
:shipit:
Breaking things, moving fast & recovery quickly.

William Ventura allexiusw

:shipit:
Breaking things, moving fast & recovery quickly.
View GitHub Profile
@allexiusw
allexiusw / couchdb_install.sh
Last active November 15, 2019 16:08
couchdb installation
#!/bin/bash
sudo su
#add repo as root
echo "deb https://apache.bintray.com/couchdb-deb stretch main" | sudo tee -a /etc/apt/sources.list
#add key
curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc | sudo apt-key add -
@allexiusw
allexiusw / couchdb_rest_operations.sh
Last active November 15, 2019 16:05
REST curl CouchDB
#set your public or local ip
IP="54.222.100.10"
#check server status
curl -X GET http://$IP:5984
#list all databases
curl -X GET http://$IP:5984/_all_dbs
#set your db_name
@allexiusw
allexiusw / node_installation.sh
Last active November 15, 2019 16:04
Install NodeJS, CouchDB and nano
#install base-tools
sudo apt-get install curl software-properties-common
#Download the setup
curl -sL https://deb.nodesource.com/setup_13.x | sudo bash -
#install nodejs on Debian
sudo apt-get install nodejs
#get version node
@allexiusw
allexiusw / install_couch_sync_gateway.sh
Last active November 15, 2019 16:01
Install Couch Sync Gateway for Mobiles
#!/bin/bash
#services are exposed to Public IP, but for security you can use nginx as gateway.
#get the package of couch sync gateway
wget http://packages.couchbase.com/releases/couchbase-sync-gateway/2.6.0/couchbase-sync-gateway-community_2.6.0_x86_64.deb
#install the package
dpkg -i couchbase-sync-gateway-community_2.6.0_x86_64.deb
@allexiusw
allexiusw / poc_shared_libraries.sh
Last active November 15, 2019 21:56
Proof of concept Shared libraries on Linux
nano sqrttest.c
/* sqrttest.c */
#include <math.h>
#include <stdio.h>
int main(void)
{
printf("%g\n", sin(3.141592654/2.0));
return 0;
}
#save the script
@allexiusw
allexiusw / install_ftp.ps1
Last active February 29, 2020 19:43
In this script we install FTP also we configure the isolate mode and some directives to allow Ftp connections without TLS 'cause we don't have SSL valid certificate.
Install-WindowsFeature Web-FTP-Server -IncludeAllSubFeature
Write-Host "Se instalo correctamente el servidor FTP"
Get-Service ftpsvc
Import-Module WebAdministration
mkdir "\inetpub\myftpsite\"
mkdir "\inetpub\myftpsite\LocalUser\"
mkdir "\inetpub\myftpsite\LocalUser\Administrador\"
mkdir "\inetpub\myftpsite\LocalUser\Administrador\public_html\"
New-WebFtpSite -Name "ftp" -Port "21" -Force
cmd /c \Windows\System32\inetsrv\appcmd set SITE "ftp" "-virtualDirectoryDefaults.physicalPath:C:\inetpub\myftpsite"
@allexiusw
allexiusw / install_ssh.ps1
Last active February 29, 2020 19:42
SSH Install using Powershell, we also add the ssh directory to the Path environment.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Write-Host "SSL connections enabled for this session"
Invoke-WebRequest -Uri https://github.com/PowerShell/Win32-OpenSSH/releases/download/v8.1.0.0p1-Beta/OpenSSH-Win64.zip -OutFile openssh-server.zip
Expand-Archive -LiteralPath .\openssh-server.zip -DestinationPath ‘C:\Program Files’
$env:Path += "C:\Program Files\OpenSSH-Win64"
cd "C:\Program Files\OpenSSH-Win64"
.\Install-sshd.ps1
Get-Service | ? Name -like *SSH*
Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'
@allexiusw
allexiusw / install_iis.ps1
Created February 27, 2020 17:39
In this gist we install IIS Role and create 2 sites running in 8080 and 8888 ports.
Install-WindowsFeature Web-Server -IncludeManagementTools
Install-Module -Name 'IISAdministration'
Get-IISSite
mkdir C:\site1
echo "<h1>Sitio 1</h1>" > C:\site1\index.html
New-IISSite -Name 'Site 1' -PhysicalPath 'C:\site1\' -BindingInformation "*:8080:"
New-NetFirewallRule -Name http1 -DisplayName 'HTTP1 Allows IIS (8080)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 8080
Get-IISSite
mkdir C:\site2
echo "<h1>Sitio 2</h1>" > C:\site2\index.html
@allexiusw
allexiusw / install_dns.ps1
Last active March 1, 2020 03:28
Install and configure DNS with Powershell. Working with zones and subdomains.
Install-WindowsFeature DNS -IncludeManagementTools
Get-Service -Name dns
Get-DnsClientServerAddress
Set-DnsClientServerAddress -InterfaceAlias "Ethernet0" -ServerAddresses 127.0.0.1,8.8.8.8
Set-DnsClientServerAddress -InterfaceAlias "Ethernet1" -ServerAddresses 127.0.0.1,8.8.8.8
Get-DnsClientServerAddress
$dominio = Read-Host "Ingresar el nombre del dominio"
Add-DnsServerPrimaryZone -Name "$dominio" -ZoneFile "db.$dominio"
$ip = Read-Host "Ingrese la IP del servidor"
Get-DnsServerResourceRecord -ZoneName "$dominio"
@allexiusw
allexiusw / ffmepg_helpful_commands
Last active April 26, 2020 08:42
ffmepg helpful commands
#Increase the volume of a video with ffmpeg
ffmpeg -i input.flv -filter:a "volume=1.5" output.flv
#join to videos with ffmpeg inputs.txt has the path to the videos you want to join
ffmpeg -f concat -i inputs.txt -safe 0 -c copy output.mp4
#Normalize videos to get consistency volume and remove noises and things like that
ffmpeg -i input.flv -filter:a loudnorm output.flv