Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Coding, coding and coding...

William Ventura allexiusw

:octocat:
Coding, coding and coding...
View GitHub Profile
View create_users.sh
#!/bin/bash
USER1="fabricio"
USER2="maria"
GROUP="admin"
echo "Iniciando la creación de usuarios"
#crea el usuario martir
useradd -m -d /home/$USER1 -s /bin/bash $USER1
@allexiusw
allexiusw / ffmepg_helpful_commands
Last active Apr 26, 2020
ffmepg helpful commands
View 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
@allexiusw
allexiusw / install_dns.ps1
Last active Mar 1, 2020
Install and configure DNS with Powershell. Working with zones and subdomains.
View install_dns.ps1
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 / install_iis.ps1
Created Feb 27, 2020
In this gist we install IIS Role and create 2 sites running in 8080 and 8888 ports.
View install_iis.ps1
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_ssh.ps1
Last active Feb 29, 2020
SSH Install using Powershell, we also add the ssh directory to the Path environment.
View install_ssh.ps1
[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_ftp.ps1
Last active Feb 29, 2020
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.
View install_ftp.ps1
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 / poc_shared_libraries.sh
Last active Nov 15, 2019
Proof of concept Shared libraries on Linux
View poc_shared_libraries.sh
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_couch_sync_gateway.sh
Last active Nov 15, 2019
Install Couch Sync Gateway for Mobiles
View install_couch_sync_gateway.sh
#!/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 / node_installation.sh
Last active Nov 15, 2019
Install NodeJS, CouchDB and nano
View node_installation.sh
#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
View couchdb_rest_operations.sh
#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