Skip to content

Instantly share code, notes, and snippets.

View fdenisnascimento's full-sized avatar

Denis Nascimento fdenisnascimento

View GitHub Profile
@fdenisnascimento
fdenisnascimento / gist:c6f4a51328f596e319a09a1ad6e78dea
Created November 4, 2023 02:06
Gist to install docker and portainer in ec2 debian
sudo apt update
sudo apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common -y
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" -y
sudo apt update
apt-cache policy docker-ce
sudo apt install docker-ce -y
sudo systemctl status docker
sudo usermod -aG docker ${USER}
id -nG
@fdenisnascimento
fdenisnascimento / Dockerfile
Last active October 4, 2023 21:44
Dockerize cakephp 2
FROM ubuntu
RUN apt update
RUN apt upgrade -y
RUN apt install -y software-properties-common
RUN add-apt-repository -y ppa:ondrej/php
RUN apt install -y apache2
RUN apt install -y apache2-utils
RUN DEBIAN_FRONTEND=noninteractive apt -y install php7.4
RUN apt install -y libapache2-mod-php7.4
@fdenisnascimento
fdenisnascimento / generate-ssh-key.sh
Created May 11, 2023 14:44 — forked from denisgolius/generate-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@fdenisnascimento
fdenisnascimento / install_android_sdk_tools_in_linux_for_custom_ci.md
Created January 10, 2023 18:20 — forked from Ashok-Varma/install_android_sdk_tools_in_linux_for_custom_ci.md
Install Android SDK tools in linux. Can be used for custom CI (Continuous Integration)
@fdenisnascimento
fdenisnascimento / AdbCommands
Created November 7, 2022 21:53 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@fdenisnascimento
fdenisnascimento / Characteristic.swift
Created June 9, 2022 17:04
ComposableArchitecture wrapper for CoreBluetooth
import Foundation
import CoreBluetooth
public struct Characteristic: Equatable {
let rawValue: CBCharacteristic?
public let identifier: CBUUID
public let value: Data?
public let isNotifying: Bool
public let descriptors: [Descriptor]?
@fdenisnascimento
fdenisnascimento / beacon, location always
Created June 8, 2022 18:04 — forked from thanhluand/beacon, location always
Beacon, request location always on IOS > 14
import Foundation
import CoreLocation
import os
class BeaconService: NSObject {
static let shared = BeaconService()
private var locationManager: CLLocationManager = CLLocationManager()
var callback: ((_ beacons: [CLBeacon])->())?
private var requestLocationAuthorizationCallback: ((CLAuthorizationStatus) -> Void)?
override init() {
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
import 'package:flutter/material.dart';
class Denis extends StatelessWidget {
final Map<String, String> states = {
"AC": "Acre",
"AL": "Alagoas",
"AP": "Amapá",
"AM": "Amazonas",
"BA": "Bahia",
"CE": "Ceará",