Skip to content

Instantly share code, notes, and snippets.

View dev-sareno's full-sized avatar
💻

Eladio Jr Sareno dev-sareno

💻
View GitHub Profile
@dev-sareno
dev-sareno / ssh-config-using-different-ssh-keys.md
Last active July 7, 2020 01:13
SSH Config - Using Different SSH keys

SSH Config

Use a multiple ssh keys for different repository/host

/.ssh/config

Host github_repo1.github.com
        User git
        Hostname github.com
        PreferredAuthentications publickey
 IdentityFile C:\Users\User1\.ssh\id_rsa_github_repo1
@dev-sareno
dev-sareno / android-google-chrome-remote-devices-without-usb-cable.md
Last active December 4, 2023 14:44
Android Google Chrome Remote Devices Without USB Cable (Windows 10)

Android Google Chrome Remote Devices Without USB Cable

Requirments

Steps

  • Open terminal (CMD etc.)
  • Navigate to adb executable $ cd C:\Users\devsareno\AppData\Local\Android\Sdk\platform-tools
@dev-sareno
dev-sareno / ionic-android-native-change-text-zoom-size.md
Last active July 7, 2020 01:09
Ionic - Android Native - Change text zoom size (Alternative to Ionic Mobile Accessibility)
package com.example.app;

import android.os.Bundle;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebView;

import com.getcapacitor.BridgeActivity;
import com.getcapacitor.Plugin;
@dev-sareno
dev-sareno / angular-production-nginx.md
Last active July 29, 2020 10:21
Angular production using NginX

Local Machine

Build Angular project

$ ng build --prod

This will generate a /dist distribution directory, upload this directory to your server using scp Secure Copy or something else.

Using Secure Copy

$ scp -r dist/my-app root@11.222.3.444:/var/www/my-app.mydomain.com

Local Machine

Build ReactJS project

$ npm run build

This will generate a /build directory, upload this directory to your server using scp Secure Copy or something else.

Using Secure Copy

$ scp -r build root@11.222.3.444:/var/www/my-app.mydomain.com

NginX's Reverse Proxy to Cloudflare-protected URL

/etc/nginx/sites-enabled/example.com.conf

server {
    server_name example.com;
    listen [::]:443 ssl;
    listen 443 ssl;

How to Install Python 3.8 on Ubuntu and Debian

Tested on Debian 10 Buster

Prerequisites

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install wget  # For downloading file
$ sudo apt-get install xz-utils  # For extracting .tar.xz files

Create a Linux Service Using systemd

Create a systemd Service

/etc/systemd/system/djangoexample-boot.service

[Unit]
Description=Service for django.example.com
Before=nginx.service
StartLimitIntervalSec=0

Creating a Custom Docker Image and Pushing it to Docker Hub

Login to Docker Hub

$ docker login

Pull a Base Docker Image

$ docker run -ti -d --name my-custom-image ubuntu:latest bash