Skip to content

Instantly share code, notes, and snippets.

View pydawan's full-sized avatar

Thiago Monteiro pydawan

View GitHub Profile
@pydawan
pydawan / ANSI.md
Created February 23, 2022 12:10 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@pydawan
pydawan / DataSourceConfig.java
Created November 26, 2020 15:41 — forked from pascaldimassimo/DataSourceConfig.java
Spring Boot config for multiple datasources and EntityManagerFactories
package com.pascaldimassimo.xyz;
import java.util.HashMap;
import java.util.Map;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.hibernate.cfg.ImprovedNamingStrategy;
import org.springframework.beans.factory.annotation.Autowired;
@pydawan
pydawan / Java8DataTimeCheatSheet.java
Created November 5, 2020 19:12 — forked from l0co/Java8DataTimeCheatSheet.java
Cheatsheet of using Java 8 date time
/**
* Here is the jdk8 datetime cheatsheet and explanation why we use ZonedDateTime and Instant in TimeService.
*/
// this is the 01.03.2016 00:00 in server timezone (Europe/Warsaw) == EXACTLY THE SAME AS THE SYSTEM TIME
ZonedDateTime zonedDateTime = ZonedDateTime.of(2016, 3, 1, 0, 0, 0, 0, ZoneId.systemDefault());
System.out.println(zonedDateTime); // 2016-03-01T00:00+01:00[Europe/Warsaw]
// this is the same 01.03.2016 00:00 but doesn't carry timezone information
LocalDateTime localDateTime = zonedDateTime.toLocalDateTime();
# One line install
echo -e "g\nn\n\n\n+100M\nt\n1\nn\n\n\n+1G\nn\n\n\n\n\nw\nq\n" | fdisk /dev/sda && mkfs.vfat -F32 /dev/sda1 && mkswap /dev/sda2 && mkfs.ext4 /dev/sda3 && swapon /dev/sda2 && mount /dev/sda3 /mnt && mkdir -p /mnt/{boot/efi,home} && mount /dev/sda1 /mnt/boot/efi && pacstrap /mnt base base-devel && genfstab -p /mnt >> /mnt/etc/fstab && echo -e "echo NomDeLaMachine > /etc/hostname && echo '127.0.1.1 NomDeLaMachine.localdomain NomDeLaMachine' >> /etc/hosts && rm -f /etc/localtime && ln -s /usr/share/zoneinfo/Europe/Paris /etc/localtime && echo 'fr_FR.UTF-8 UTF-8' >> /etc/locale.gen && locale-gen && echo 'LANG=fr_FR.UTF-8' > /etc/locale.conf && echo KEYMAP=fr > /etc/vconsole.conf && mkinitcpio -p linux" | arch-chroot /mnt && echo -e "pacman --noconfirm -Syu xorg-server xorg-xinit xorg-server-utils xf86-video-intel xf86-input-synaptics gdm gnome networkmanager terminator emacs atom gcc valgrind firefox chromium git openssh" | arch-chroot /mnt && echo -e "useradd -Nm -g users -G wheel,sys epitech_
@pydawan
pydawan / gnome-tracker-disable.md
Created October 30, 2020 20:02 — forked from vancluever/gnome-tracker-disable.md
GNOME Tracker Disable

Disabling GNOME Tracker and Other Info

GNOME's tracker is a CPU and privacy hog. There's a pretty good case as to why it's neither useful nor necessary here: http://lduros.net/posts/tracker-sucks-thanks-tracker/

After discovering it chowing 2 cores, I decided to go about disabling it.

Directories

@pydawan
pydawan / gist:a660d552f7c73302228e3668cdb8521b
Created October 29, 2020 18:48 — forked from wbotelhos/gist:3165894
Install SQL Developer on Ubuntu
# Download: http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html
sudo apt-get install alien
sudo alien -k --scripts sqldeveloper*.rpm
sudo dpkg -i sqldeveloper*.deb
mkdir -p ~/.sqldeveloper
# Paste the JDK path inside (/usr/lib/jvm/java-1.6.0-openjdk-i386)
vim ~/.sqldeveloper/jdk
@pydawan
pydawan / 1-elementary-os-apps.md
Created October 29, 2020 05:43 — forked from ankurk91/1-elementary-os-apps.md
elementary OS 5.1 Hera

elementaryOS Apps and Configs

This guide has been updated for elementaryOS v5.0+.

Enbale PPA support

sudo apt-get update
sudo apt-get -y install software-properties-common

Elementary tweaks

@pydawan
pydawan / GroovyAnsi.groovy
Created October 27, 2020 18:00 — forked from tvinke/GroovyAnsi.groovy
Simple ANSI colors in the terminal written in Groovy
// Ansi colors in Groovy
// Author: Ted Vinke
import static Ansi.*
println color("BOLD", Ansi.BOLD)
println color("ITALIC", Ansi.ITALIC)
println color("UNDERLINE", Ansi.UNDERLINE)
println color("BLINK", Ansi.BLINK)
println color("RAPID_BLINK", Ansi.RAPID_BLINK)
println color("REVERSE_VIDEO", Ansi.REVERSE_VIDEO)
@pydawan
pydawan / sources.list
Created October 23, 2020 20:03 — forked from ishad0w/sources.list
Ubuntu 20.04 LTS (Focal Fossa) -- Full sources.list
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
@pydawan
pydawan / gitcom.md
Last active October 5, 2020 13:16 — forked from jednano/gitcom.md
Common git commands in a day-to-day workflow

Git Cheat Sheet

Initial Setup

Create an empty git repo or reinitialize an existing one

git init