$ sudo apt update
$ sudo apt install \
apt-transport-https \
ca-certificates \
curl \
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
| a=[10,20,30] | |
| m=["Jan","Feb","Mar"] | |
| h={} | |
| a.collect{|x| h[m[a.index(x)]]=x} | |
| a #=> [10,20,30] | |
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
| l=Lancamento.find(:all).collect{ |l| [l.data.month, l.valor]} #=> [[3, 100.0], [10, 321.54]] | |
| l.transpose #=> [[3, 10], [100.0, 321.54]] |
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
| # Stop all containers | |
| docker stop $(docker ps -a -q) | |
| # Remove all containers | |
| docker rm $(docker ps -a -q) | |
| # Remove all volumes | |
| docker volume rm $(docker volume ls -q) |
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
| # Save this content to /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla | |
| [Re-enable hibernate by default in upower] | |
| Identity=unix-user:* | |
| Action=org.freedesktop.upower.hibernate | |
| ResultActive=yes | |
| [Re-enable hibernate by default in logind] | |
| Identity=unix-user:* | |
| Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.hibernate-multiple-sessions | |
| ResultActive=yes |
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
| sudo add-apt-repository ppa:webupd8team/java | |
| sudo apt-get update | |
| sudo apt-get install oracle-java8-installer |
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
| if [[ -z "$1" ]]; then | |
| echo "No argument supplied. Usage: pgsqlconfig.sh <appname>" | |
| exit 1 | |
| fi | |
| if ! $(psql template1 -c 'SHOW SERVER_ENCODING' | grep -q UTF8); then | |
| psql postgres -c "update pg_database set datallowconn = TRUE where datname = 'template0';" | |
| psql template0 -c "update pg_database set datistemplate = FALSE where datname = 'template1';" | |
| psql template0 -c "drop database template1;" | |
| psql template0 -c "create database template1 with template = template0 encoding = 'UTF8';" |
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
| set serveroutput on; | |
| declare | |
| nm_table varchar(100) := 'NOTA_FISCAL_HIST'; | |
| nm_nullable varchar(100); | |
| begin | |
| for r in ( select c.* from all_tables t | |
| inner join all_tab_columns c | |
| on c.TABLE_NAME = t.TABLE_NAME | |
| where t.TABLE_NAME = nm_table | |
| order by c.column_id |
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
| import org.junit.Test; | |
| import org.junit.runner.RunWith; | |
| import org.master.Application; | |
| import org.springframework.beans.factory.annotation.Value; | |
| import org.springframework.boot.test.IntegrationTest; | |
| import org.springframework.boot.test.SpringApplicationConfiguration; | |
| import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; | |
| import org.springframework.security.oauth2.client.DefaultOAuth2ClientContext; | |
| import org.springframework.security.oauth2.client.OAuth2RestTemplate; | |
| import org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsResourceDetails; |
OlderNewer