Skip to content

Instantly share code, notes, and snippets.

View bashizip's full-sized avatar
🌍

Patrick Bashizi bashizip

🌍
View GitHub Profile
import java.io.FileOutputStream;
import java.sql.Blob;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import com.codesjava.util.JDBCUtil;
/**
* This class is used to retrieve a image from DB.
* @author bashizip
This file has been truncated, but you can view the full file.
-- --------------------------------------------------------
-- Hôte : 51.255.35.182
-- Version du serveur: 10.0.29-MariaDB-0ubuntu0.16.04.1 - Ubuntu 16.04
-- SE du serveur: debian-linux-gnu
-- HeidiSQL Version: 9.4.0.5125
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
This file has been truncated, but you can view the full file.
-- --------------------------------------------------------
-- Hôte : 127.0.0.1
-- Version du serveur: 10.1.22-MariaDB - mariadb.org binary distribution
-- SE du serveur: Win64
-- HeidiSQL Version: 9.4.0.5125
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
@bashizip
bashizip / Update remote repo
Created August 5, 2019 17:33 — forked from mandiwise/Update remote repo
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
$ git remote rm origin
$ git remote add origin [email protected]:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@bashizip
bashizip / adb_wifi.txt
Created September 29, 2019 21:30
connect adb via wifi
Connect the device via USB and make sure debugging is working;
adb tcpip 5555. This makes the device to start listening for connections on port 5555;
Look up the device IP address with adb shell netcfg or adb shell ifconfig with 6.0 and higher;
You can disconnect the USB now;
adb connect <DEVICE_IP_ADDRESS>:5555. This connects to the server we set up on the device on step 2;
Now you have a device over the network with which you can debug as usual.
To switch the server back to the USB mode, run adb usb, which will put the server on your phone back to the USB mode.
If you have more than one device, you can specify the device with the -s option: adb -s <DEVICE_IP_ADDRESS>:5555 usb.
@bashizip
bashizip / 1-load_gtdb_script.cql
Created February 18, 2020 13:06 — forked from rvanbruggen/1-load_gtdb_script.cql
Global Terrorism Database
//load Global Terrorism Database
//Copy/Paste the load script below into your Neo4j-shell command-line utility
//In order to accelerate the loading process, you want to download the CSV file from
//https://www.dropbox.com/s/oequ58lrp8f9w6v/gtdb_transform.csv?dl=1 and then to a local file.
//After that, you would of course need to replace the URL in all of the queries below, and replace it with
//load csv with headers from "file:/path/to/your/file.csv" as csv
//load the countries
load csv with headers from "https://www.dropbox.com/s/oequ58lrp8f9w6v/gtdb_transform.csv?dl=1
@bashizip
bashizip / switch_to_mysql_native_password.md
Created July 22, 2020 12:32 — forked from rohsyl/switch_to_mysql_native_password.md
MariaDB switch to mysql_native_password

Switch to mysql_native_password plugin

By default MariaDB use the unix_socket plugin to authenticate users.

But it's easier to use mysql_native_password for dev (and only for dev because it's way less secure).

Get root access

sudo su
@bashizip
bashizip / SwingFXWebView.java
Created August 30, 2020 16:06 — forked from anjackson/SwingFXWebView.java
Embedding a JavaFX WebView in a Swing panel.
import com.sun.javafx.application.PlatformImpl;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javafx.application.Platform;
import javafx.collections.ObservableList;
import javafx.embed.swing.JFXPanel;
import javafx.scene.Group;
import javafx.scene.Node;
@bashizip
bashizip / postgres-cheatsheet.md
Created April 18, 2022 22:36 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)