Skip to content

Instantly share code, notes, and snippets.

View asssis's full-sized avatar

Assis Junior Siebra Barbosa asssis

View GitHub Profile
@asssis
asssis / instalar o kubernet
Created June 16, 2022 03:37
instalar o kubernet
if [[ $(id -u) -ne 0 ]]
then echo "Por favor, executar como root"
exit 1
fi
apt-get update
apt-get install -y docker.io
apt-get install -y apt-transport-https ca-certificates curl
curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
apt-get update
@asssis
asssis / solid
Last active August 6, 2021 12:33
solid
pragma solidity 0.5.3;
contract HelloWorld{
string public text;
uint public number;
address public userAddress;
bool public answer;
mapping (address => uint) public hasInteracted;
function setText(string memory myText) public {
@asssis
asssis / docker install software
Last active June 18, 2022 15:38
docker install software
docker stop postgres redis elastcsearch
docker container rm postgres redis elastcsearch
docker run --name postgres -e POSTGRES_PASSWORD=postgres -d -v="pgdata:/var/lib/postgresql/data" -p 5432:5432 postgres
docker run --name redis -d -p 6379:6379 -p 6380:6379 redis
docker run --name elastcsearch -d -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.7.2
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=aaabbbccc1234" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-CU15-ubuntu-20.04 => levantar sql
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer(@"Server=localhost,1433;Database=HereApp;User Id=sa;Password=aaabbbccc1234;");
@asssis
asssis / installar rails
Last active March 17, 2024 17:38
instllar rails
#COPIE O SCRIPT COLA DENTRO DE install.sh
#JOGA PARA O DOCUMENTO SO
#chmod +777 install.sh
#./install.sh
# RODAR COMO ROOT OU SUDO
if [[ $(id -u) -ne 0 ]]
then echo "Por favor executar como root"
exit 1
@asssis
asssis / gerenciar processos por thread
Last active May 30, 2021 13:47
gerenciar processos por thread
array.each do |x|
puts '----------iniciando novo processo------------'
thread << Thread.new do
begin
Timeout::timeout(60 * 10) do
executar_processo(malha)
end
rescue
end
end
@asssis
asssis / comandos docker
Last active June 18, 2024 18:42
comandos docker
#instalando docker
sudo snap install docker
sudo docker ps
sudo groupadd docker
sudo usermod -aG docker ${USER}
su -s ${USER}
docker ps
sudo docker pull postgres
docker images
@asssis
asssis / redis.conf
Created March 1, 2021 15:04
redis.conf
# Redis configuration file example.
#
# Note that in order to read the configuration file, Redis must be
# started with the file path as first argument:
#
# ./redis-server /path/to/redis.conf
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
@asssis
asssis / cors dot.net
Created February 9, 2021 21:10
cors dot.net
[Route("api/[controller]")]
[ApiController]
public class WidgetController : ControllerBase
{
// GET api/values
[EnableCors("AnotherPolicy")]
[HttpGet]
public ActionResult<IEnumerable<string>> Get()
{
return new string[] { "green widget", "red widget" };
@asssis
asssis / animation transição rotate
Created January 25, 2021 19:49
animation transição rotate
<style lang="scss">
.rotate-in {
opacity: 0;
animation: rotate 500ms linear;
animation-fill-mode: forwards;
@for $i from 1 through 12 {
&:nth-child(#{$i}) {
animation-delay: $i * 50ms;
}
}
@asssis
asssis / codigo_arvore c#
Created November 19, 2020 16:17
codigo_arvore c#
using System.Collections.Generic;
using System;
using System.Linq;
public class Program
{
public static void Main()
{
Arvore obj = new Arvore();
obj.add("a","b");