This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'SUBSYSTEM=="memory", ACTION=="add", ATTR{state}="online"' > /etc/udev/rules.d/100-balloon.rules | |
yum install -y hyperv-daemons | |
yum install -y bash-completion | |
yum install -y vim-enhanced | |
yum install -y yum-utils | |
echo noop > /sys/block/sda/queue/scheduler |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#function New-LinuxVM { | |
#requires -Modules Hyper-V | |
[CmdletBinding(SupportsShouldProcess=$true)] | |
param | |
( | |
[Parameter(Mandatory=$true, Position=1)][String]$VMName, | |
[Parameter()][String]$VHDXName = '', | |
[Parameter()][String]$VMStoragePath = '', | |
[Parameter()][String]$VHDStoragePath = '', | |
[Parameter()][String]$InstallISOPath = 'C:\Users\giova\Downloads\CentOS-7-x86_64-Minimal-1708.iso', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#stop logging services | |
/sbin/service rsyslog stop | |
/sbin/service auditd stop | |
#remove old kernels | |
/bin/package-cleanup --oldkernels --count=1 | |
#clean yum cache | |
/usr/bin/yum clean all | |
#force logrotate to shrink logspace and remove old logs as well as truncate logs | |
/usr/sbin/logrotate -f /etc/logrotate.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Determine the version of RHEL | |
COND=`grep -i Taroon /etc/redhat-release` | |
if [ "$COND" = "" ]; then | |
export PREFIX="/usr/sbin" | |
else | |
export PREFIX="/sbin" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" ?> | |
<module xmlns="urn:jboss:module:1.3" name="org.postgresql"> | |
<resources> | |
<resource-root path="postgresql-42.1.4.jar"/> | |
</resources> | |
<dependencies> | |
<module name="javax.api"/> | |
<module name="javax.transaction.api"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT ddlsql || regexp_replace(name, E'^_',E'','g') || ';' as ddlsql FROM | |
( | |
SELECT 'ALTER TABLE ' || quote_ident(c.table_schema) || '.' | |
|| quote_ident(c.table_name) || ' RENAME "' || c.column_name || '" TO ' As ddlsql, quote_ident(lower(regexp_replace(column_name, E'([A-Z])', E'\_\\1','g'))) as name | |
FROM information_schema.columns As c | |
WHERE c.table_schema NOT IN('information_schema', 'pg_catalog') | |
AND c.column_name <> lower(c.column_name) | |
ORDER BY c.table_schema, c.table_name, c.column_name | |
) x; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT ddlsql || regexp_replace(name, E'^_',E'','g') As ddlsql FROM (SELECT 'ALTER TABLE ' || quote_ident(t.table_schema) || '.' | |
|| quote_ident(t.table_name) || ' RENAME TO ' As ddlsql, quote_ident(lower(regexp_replace(t.table_name, E'([A-Z])', E'\_\\1','g'))) || ';' as name | |
FROM information_schema.tables As t | |
WHERE t.table_schema NOT IN('information_schema', 'pg_catalog') | |
AND t.table_name <> lower(t.table_name) | |
ORDER BY t.table_schema, t.table_name) x; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.AspNet.Mvc; | |
namespace WebApplication1.Controllers | |
{ | |
public class HomeController : Controller | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package framework; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.core.Ordered; | |
import org.springframework.core.env.Environment; | |
import org.springframework.util.Assert; | |
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Main extends App { | |
val nomes = Seq("Twing","Twing","Twofi") | |
def imprimirSeq(seq: Seq[String], filtro: Filtro){ | |
val filtrados = filtro.filtrar(seq) | |
filtrados.foreach(println) | |
} | |
imprimirSeq(nomes, new FiltrarPorNome("Twing")) | |
imprimirSeq(nomes, new FiltrarPorComecarCom("Tw")) | |
imprimirSeq(nomes, new Filtro { | |
override def filtrar(valores: Seq[String]) = { |