Skip to content

Instantly share code, notes, and snippets.

View luizrobertofreitas's full-sized avatar

Luiz Roberto Freitas luizrobertofreitas

View GitHub Profile
@luizrobertofreitas
luizrobertofreitas / get_repos.rb
Created January 7, 2022 11:57 — forked from kruszczynski/get_repos.rb
Github GraphQL query for repos, their topics, and Gemfile
require 'httparty'
def get_data
query = File.open('repos.graphql', 'r').read
token = 'https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/'
cursor = nil
repos = []
org = 'evil_mega_corp'
loop do
@luizrobertofreitas
luizrobertofreitas / mysql-docker.sh
Created August 12, 2019 14:23 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@luizrobertofreitas
luizrobertofreitas / nginx.conf
Created May 10, 2019 13:32 — forked from morhekil/nginx.conf
Full request/response body logging in nginx
http {
log_format bodylog '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_time '
'<"$request_body" >"$resp_body"';
lua_need_request_body on;
set $resp_body "";
body_filter_by_lua '
@luizrobertofreitas
luizrobertofreitas / checkpoint-snx-vpn-client-fedora25.txt
Created May 16, 2017 13:20 — forked from rafaeltuelho/checkpoint-snx-vpn-client-fedora25.txt
setup Checkpoint Firewall VPN with SNX on Linux Fedora 25
First you have to ensure the Java JRE is installed on your system.
Remember the java plugin will only work on Firefox. If you prefer to install from fedora/rhel repos:
sudo dnf (yum) install java-1.8.0-openjdk icedtea-web
download the snx script installer from the Checkpoint VPN page:
https://<your company vpn ip addr>/sslvpn/SNX/INSTALL/snx_install.sh
run int as root to install
<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="order-old" transaction-type="RESOURCE_LOCAL">
<class>model.Order</class>
<class>model.OrderLine</class>
<class>model.Customer</class>
<properties>
<!-- Change this to access your own database. -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.projectboard</groupId>
<artifactId>projectboard</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>Project Board</name>
<description>Project management dashboard.</description>