Skip to content

Instantly share code, notes, and snippets.

View diegorribeiro's full-sized avatar

Diego Ribeiro diegorribeiro

View GitHub Profile
@diegorribeiro
diegorribeiro / dockerbuild.sh
Last active February 19, 2025 18:43
Docker build on oci Oracle Cloud
# React JS / npm run build
## docker build image with build folder and push to oci cloud
docker buildx build --platform linux/amd64,linux/arm64 -t [YOURSERVERLOCATION].ocir.io/[YOURNAMESPACE]/[CONTAINER_NAME]:v[VERSION] --push .
# Node JS with npm run build -> tsc / tsconfig.json
## docker build image with dist folder and push to oci cloud
docker buildx build --platform linux/amd64,linux/arm64 -t [YOURSERVERLOCATION].ocir.io/[YOURNAMESPACE]/[CONTAINER_NAME]:v[VERSION] --push .
@diegorribeiro
diegorribeiro / iptables.sh
Created February 19, 2025 18:16
Iptables example
# iptables command for port 80 (Web ports)
sudo iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT
# iptables command for port 3000 (Node or other)
sudo iptables -D INPUT -p tcp -m tcp --dport 3000 -j ACCEPT

Copy Bitbucket repo to GitHub

Whenever possible, use GH's "Import repository" feature.

The import feature doesn't always work, though. In my experience, I tried to import a repo and it failed with a generic message. I had to contact GH support to ask for help. They told me my repo had a large file (>100MB), which couldn't be added to GH directly. I had to either remove the file or store it in GH LFS. In this case, one of the CLI methods below are needed:

CLI: Copy the master branch only (OK)

@diegorribeiro
diegorribeiro / php-config-external.md
Created May 25, 2023 20:23
Configurando o PHP para ser acessado por outro pc na rede

Essa configuração servirá para quem está testando a api por um outro computador que não seja o localhost da aplicação. dessa forma você poderá testar se seu app está funcionando com a api respondendo de maneira correta e simular o cenário de um servidor externo.

Procure o arquivo httpd.conf na pasta do PHP e encontre as seguintes linhas:

DocumentRoot "c:/xampp/htdocs"
<Directory "c:/xampp/htdocs">
    # ...Stuffs in here
    Options Indexes FollowSymLinks
    # ...Stuffs in here
@diegorribeiro
diegorribeiro / config.md
Created May 16, 2023 11:47
Zsh environment for Android SDK

Goto zsh terminal and run these steps bellow:

Create .zshenv file

$ touch ~/.zshenv

Run vim and edit the .zshenv file

$ vim ~/.zshenv

Copy e Paste these commands in zshenv file

$ export ANDROID_HOME=/Users/#YOUR_USER_HERE/Library/Android/sdk

@diegorribeiro
diegorribeiro / podforceupdate.sh
Created May 11, 2023 20:53 — forked from mbinna/podforceupdate.sh
Clear CocoaPods cache, re-download and re-install all pods
#!/usr/bin/env bash
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
@diegorribeiro
diegorribeiro / change-tools.MD
Created May 11, 2023 20:53
If you run pod install and failed due to glog during project initialisation

Change commant Line Tools location

I'm using XCode Version 14.0 and have select Command Line Tools from its Locations tab. I also tried:

sudo xcode-select --switch /Applications/Xcode.app

@diegorribeiro
diegorribeiro / DOWNGRADE.md
Created April 18, 2023 22:43
React-native npm start -> Error message "error:0308010C:digital envelope routines::unsupported"

// IF you are using node 17 and you see this error: // Error message "error:0308010C:digital envelope routines::unsupported"

// Downgrade to node 16.13.0

// And Install the nvm using chocolatey: choco install nvm

// Go to your project folder and run this command: nvm install 16.13.0

@diegorribeiro
diegorribeiro / ohmyz.sh
Created December 1, 2022 23:07
Zsh better customizing
# Trust me, you can't do a better job customizing your own .zshrc file.
# Just go here: https://ohmyz.sh/#install
# Run this command in your terminal:
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
@diegorribeiro
diegorribeiro / Xcode_remove_all_files.MD
Last active November 29, 2022 18:53
For a complete removal of Xcode

For a complete removal of Xcode 10 delete the following:

Run in terminal rm -rf and the lines below one by one

/Applications/Xcode.app
~/Library/Caches/com.apple.dt.Xcode
~/Library/Developer
~/Library/MobileDevice
~/Library/Preferences/com.apple.dt.Xcode.plist

/Library/Preferences/com.apple.dt.Xcode.plist