Skip to content

Instantly share code, notes, and snippets.

View fdenisnascimento's full-sized avatar

Denis Nascimento fdenisnascimento

View GitHub Profile
@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() {
@fdenisnascimento
fdenisnascimento / cakephp_output_excel_file
Created November 13, 2017 11:35 — forked from EricYue2012/cakephp_output_excel_file
How to generate excel file in cakephp
//excel layout
<?php
header ("Expires: Mon, 28 Oct 2008 05:00:00 GMT");
header ("Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate");
header ("Pragma: no-cache");
header ("Content-type: application/vnd.ms-excel");
header ("Content-Disposition: attachment; filename=\"report_".date('dmy_His').".xls" );
header ("Content-Description: Generated Report" );
?>
#https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04
sudo apt-get update
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update