Skip to content

Instantly share code, notes, and snippets.

View daltonjorge's full-sized avatar

Dalton Jorge daltonjorge

  • UFCG
  • Brazil - Paraiba - Campina Grande
View GitHub Profile
@daltonjorge
daltonjorge / gitea_backup.sh
Created October 5, 2025 02:49
Gitea Backup
docker exec -u git -it -w /tmp $(docker ps -qf 'name=^<NAME_OF_DOCKER_CONTAINER>$') bash -c '/usr/local/bin/gitea dump --config /data/gitea/conf/app.ini'
@daltonjorge
daltonjorge / close_existing_connections_sqlserver_database.sql
Last active September 25, 2025 23:08
Close existing connections to a SQL Server database #sqlserver #sql #database
-- disconnect all other sessions connected to the database 'syscit'
USE master;
GO
ALTER DATABASE syscit SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
GO
-- drop the database 'syscit' if it exists
IF EXISTS (SELECT name FROM sys.databases WHERE name = N'syscit')
BEGIN
DROP DATABASE syscit;
END
@daltonjorge
daltonjorge / main.md
Created February 25, 2025 00:45 — forked from jabbany/main.md
Setting up podman + nvidia on F37 - F40 (Self notes)

Follow the following instructions:

  1. Install the C compiler through sudo dnf group install "C Development Tools and Libraries"
  2. Install the kernel headers sudo dnf install kernel-devel
  3. Download the latest drivers (replace with URL from nvidia website)
    wget https://us.download.nvidia.com/XFree86/Linux-x86_64/550.54.14/NVIDIA-Linux-x86_64-550.54.14.run
    chmod a+x NVIDIA-Linux-x86_64-550.54.14.run
    sudo ./NVIDIA-Linux-x86_64-550.54.14.run
    
@daltonjorge
daltonjorge / console-via-role.py
Created November 21, 2022 00:19 — forked from carlosevieira/console-via-role.py
This script generates a federated URL using the credentials obtained via SSRF in the AWS metadata to access the console on AWS
import requests
import datetime
import json
import urllib
session_data = {
'sessionId': '[AWS_ACCESS_KEY_ID]',
'sessionKey': '[AWS_SECRET_ACCESS_KEY]',
'sessionToken': '[AWS_SESSION_TOKEN]'
}
@daltonjorge
daltonjorge / Jest_GitLab_CI.md
Created June 13, 2022 15:11 — forked from rishitells/Jest_GitLab_CI.md
Setting up Jest tests and coverage in GitLab CI

Configuring Jest Tests in GitLab CI

1. Add GitLab CI configuration file in the root

In the root of your project, add .gitlab-ci.yml with the configuration below.

image: node:latest

stages:
@daltonjorge
daltonjorge / Dealing with secrets.md
Last active May 3, 2022 17:03 — forked from maelvls/README.md
Ubuntu, libsecret, git-credential-helper

Dealing with secrets

GNOME comes with libsecret. You can use libsecret to store your git credentials:

sudo apt install libsecret-1-0 libsecret-1-dev libglib2.0-dev
sudo make --directory=/usr/share/doc/git/contrib/credential/libsecret
git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
@daltonjorge
daltonjorge / gist:ca67499cd5b2233d8a381640e606cda6
Created April 7, 2022 20:31
Allow http connection in Firefox
- Open "about:config";
- Search for "security.tls.version.min";
- Set value to 1.
@daltonjorge
daltonjorge / gnome.yml
Created December 27, 2021 20:15 — forked from carlwgeorge/gnome.yml
ansible playbook for my gnome setup
# https://docs.ansible.com/ansible/latest/modules/dconf_module.html
#
# To determine what dconf keys and values to use, you can run `dconf watch /`
# in a terminal as you make changes in settings or tweaks. You can also use
# `dconf read <key>` and `dconf write <key> <value>` to experiment with various
# settings. The dconf-editor application is also useful for exploring various
# keys along with their descriptions.
- hosts: localhost
tasks:
@daltonjorge
daltonjorge / nginxproxy.md
Created November 20, 2021 11:45 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@daltonjorge
daltonjorge / Add_a_total_row_to_a_R_data_frame.R
Created July 22, 2021 12:32
Add a total row to a R data frame
% Solution 1
original_data_frame <- data.frame(
name = c('John','Paul','Mary'),
age = c(25, 30, 20),
salary = c(90000, 110000,85000)
)
new_df_with_totals <- data.frame(
name = 'Total',
colSums(t(original_data_frame[,-1]))