Skip to content

Instantly share code, notes, and snippets.

View juanonsoftware's full-sized avatar

Juan on Software juanonsoftware

  • Rabbit Software
  • Vietnam
View GitHub Profile
@juanonsoftware
juanonsoftware / ATMAMAS MT5 BOT.txt
Created December 14, 2023 02:02
ATMAMAS MT5 BOT
Autotrading bot
@juanonsoftware
juanonsoftware / Git-Submodule
Last active November 22, 2023 02:22
Git Submodule practices
To add other repos as submodules in an existing git repo
1. Create a public repo for submodule https://github.com/juanonsoftware/PocGitAsPublicSubmodule, with some content.
2. Checkout the main public repo https://github.com/juanonsoftware/PocGitWorkflows
3. Run a command to add the child-repo as a submodule
git submodule add -f https://github.com/juanonsoftware/PocGitAsPublicSubmodule.git PublicSubmodule
@juanonsoftware
juanonsoftware / deploy docker containers and self-hosted runners
Last active November 20, 2023 05:32
Configure Self-hosted Runners & Deploy from Docker Hub
Trigger a build from Github Actions, then deploy an application running in Docker on our "Laptop".
Add a self-hosted runners and execute scripts to deploy docker containers
1. Go to repo settings to add new hosted runner
2. Config the runner (Windows)
3. Create a new workflow yml file & job to use the configured runner
@juanonsoftware
juanonsoftware / CD with Github Actions
Last active November 17, 2023 08:59
Poc Github Actions deployments
Deploy a product from Github Actions
1. Go to repository settings
2. Add Environments and set the variables
@juanonsoftware
juanonsoftware / Use winget to install software
Last active November 17, 2023 09:00
Use winget to install new application on Windows 11
Details of the package manager -> https://learn.microsoft.com/en-us/windows/package-manager/winget/
1. Search for packages
- winget search git -> to search for packages containing "git"
2. From the output, I can see TortoiseGit. Its id is TortoiseGit.TortoiseGit
3. Run install command to install this app
- winget install TortoiseGit.TortoiseGit -> winget will download the app and display a confirmation to install
4. Now it's ready to use, right click on a folder / show more to see git menus
@juanonsoftware
juanonsoftware / Working with GIT
Last active November 17, 2023 09:00
Poc GIT workflows
1. Create a git repo https://github.com/juanonsoftware/PocGitWorkflows
2. In Windows, create a folder D:\Dev\PocGitWorkflows
3. Open the Terminal and do the following on that folder:
- git init -> to init an empty git repo
- create a txt file called Readme.txt
- git add -A -> to add all changes from tracked / untracked files
- git commit -m "First commit in the repo" -> commit for the first time
- git remote add origin https://github.com/juanonsoftware/PocGitWorkflows.git -> to add a remote
-> git push -u origin master -> to push the local branch to remote repo
3. Now refresh https://github.com/juanonsoftware/PocGitWorkflows to see the new file available on github
@juanonsoftware
juanonsoftware / Setup-MultiRoles-Web+Database.p1
Last active August 2, 2023 04:37
Scripts to install packages for a multi roles server (Webserver with IIS & .NET and Database server with SQL Server 2014)
# 1. Setup IIS
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole, IIS-WebServer
Install-WindowsFeature -Name "Web-CertProvider"
Install-WindowsFeature -Name Web-Asp-Net45
# 2. Setup Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# 3. Setup Net 6 & IIS extensions
# 3.1. NET6
@juanonsoftware
juanonsoftware / System Design.md
Created November 9, 2022 09:55 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@juanonsoftware
juanonsoftware / RavenDB - Start with RavenDB 4.2.txt
Last active May 20, 2021 03:07
Steps to start working with RavenDB version 4.2
This contains some steps to start working with RVDB 4.2
1. Download the zip at https://ravendb.net/download
2. Unzip to a folder eg D:\Tools\RavenDB\RavenDB-4.2.113-windows-x64
3. Start a PowerShell in Admin mode and change to RVDB folder, execute run.ps1 script
4. Go through some simple steps, ignore configuring any server certificate, we can start using RVDB at this address: http://127.0.0.1:8080/studio/index.html
@juanonsoftware
juanonsoftware / remove-useless-characters.cs
Created October 1, 2020 11:00
Remove useless characters from a text stream (read from a text file / html file....)
// Remove multi spaces
const string reduceSpaces = @"[ ]{2,}";
var finalText = Regex.Replace(allText.Replace('\t', ' '), reduceSpaces, " ");
// Remove empty lines
const string emptyLine = @"^\s+$[\r\n]*";
var finalText = Regex.Replace(finalText, emptyLine, string.Empty, RegexOptions.Multiline);