Skip to content

Instantly share code, notes, and snippets.

@dantheman213
dantheman213 / import_db_structure.sh
Last active April 19, 2022 13:12
Batch import all *.sql files in a folder recursively into your Postgres or PostgreSQL database
#!/bin/sh
# AUTHOR
# DANIEL E. GILLESPIE (2016)
# https://github.com/dantheman213
# DESCRIPTION
# Import all *.sql files in a folder recuresively into your PostgreSQL database
# Batch export all table schemas and stored functions with this script located here:
@dantheman213
dantheman213 / export_db_structure.sh
Last active March 5, 2024 02:55
Batch backup and export your Postgres or PostgreSQL table schemas and stored functions or procedures into individual *.sql files --the easy way!
#!/bin/sh
# AUTHOR
# DANIEL E. GILLESPIE (2016)
# https://github.com/dantheman213
# DESCRIPTION
# Export your app's table schemas and stored functions from a PostgreSQL
# database into individual *.sql files for easy management and source control.
@wavezhang
wavezhang / java_download.sh
Last active April 26, 2024 10:36
download java from oracle without login
wget -c --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active April 19, 2024 12:30
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@darkguy2008
darkguy2008 / UDPSocket.cs
Last active April 21, 2024 14:48
Simple C# UDP server/client in 56 lines
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace UDP
{
public class UDPSocket
{
private Socket _socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
@gotev
gotev / AllCertificatesAndHostsTruster.java
Last active February 15, 2021 00:52
Use self-signed certificates in Java and Android (development only!)
import android.util.Log;
import java.security.SecureRandom;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
@apolloclark
apolloclark / postgres cheatsheet.md
Last active March 7, 2024 13:53
postgres cheatsheet

Postgres Cheatsheet

This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.

Setup

installation, Ubuntu

http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL

@haisum
haisum / script.sh
Created September 1, 2015 06:10
comment and uncomment lines in bash script via sed
sed -i '/<pattern>/s/^/#/g' file #comment
sed -i '/<pattern>/s/^#//g' file #uncomment
@nlowe
nlowe / Controller.java
Last active July 11, 2018 16:07
JavaFX Table Cell Progress Bar in CSS
import javafx.fxml.Initializable;
import javafx.scene.control.Slider;
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import java.net.URL;
import java.util.ResourceBundle;
public class Controller implements Initializable {
@dantheman213
dantheman213 / Great GNU Screen config
Last active March 13, 2020 05:31
GNU Screen configuration file that helps to optimize your experience
# GNU Screen
# Preferred Configuration File
# Turn off start up message
startup_message "off"
# Allow bold colors
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground