Skip to content

Instantly share code, notes, and snippets.

@emrahoruc
emrahoruc / how-to-install-graalvm-linux.md
Created March 5, 2021 17:03 — forked from ricardozanini/how-to-install-graalvm-linux.md
How to install GraalVM on Linux with alternatives

How to Install GraalVM Community Edition on Linux

Note: Tested on Fedora only

  1. Download the new release of GraalVM and unpack it anywhere in your filesystem:
$ tar -xvzf graalvm-ce-1.0.0-rc14-linux-amd64.tar.gz
@emrahoruc
emrahoruc / linux-command-lines.md
Last active May 30, 2025 07:43
Linux Command Lines

Compress

tar -cvzf backup.tgz /home/user/project

Extract

tar -xvzf backup.tgz

Copy Lots And Large Files

rsync -avhW --no-compress --progress --exclude 'file_or_dir' /source/ /target/

See Largest 20 Folders

@emrahoruc
emrahoruc / pgsql.sql
Last active May 30, 2025 23:12
Postgresql Commands
-- Set Id Seq
SELECT setval('tablename_id_seq', (SELECT MAX(id) FROM public.tablename));
-- Log in
sudo -i -u postgres
psql dbname username
-- Backup
sudo -u postgres pg_dump -U postgres -d mydb -F c -f /tmp/mydb.backup
@emrahoruc
emrahoruc / Postgresql13_Postgis_Pgrouting.md
Created February 1, 2021 11:01
CentOS 7 + Postgresql 13 + Postgis 3.1 + Pgrouting
@emrahoruc
emrahoruc / hba_note.md
Created January 16, 2021 17:06 — forked from raprasad/hba_note.md
Postgres: Update pg_hba.conf for Static IP

Find pg_hba.conf file location

bash-4.1$ psql
psql (8.4.20)
Type "help" for help.

postgres=# SHOW hba_file;
            hba_file             

CentOS 7

Java
yum install java-1.8.0-openjdk

Setting the JAVA_HOME Variable

sudo cp /etc/profile /etc/profile_backup #Backup the profile file in order to prevent unintentional mistakes

@emrahoruc
emrahoruc / TopDirectoriesAndFiles.sh
Created August 6, 2018 08:11
How to Find Out Top Directories and Files (Disk Space) in Linux
# Find Biggest Files and Directories
# Run the following command to find out top biggest directories under /home partition.
du -a /home | sort -n -r | head -n 5
# To display the largest folders/files including the sub-directories, run:
du -Sh /home | sort -rh | head -5
# PARAMETERS
# du command: Estimate file space usage.
# a : Displays all files and folders.
@emrahoruc
emrahoruc / array-map-break-yield.php
Created September 19, 2017 12:25 — forked from dave1010/array-map-break-yield.php
array_map in php, with break
<?php
class BreakOut extends Exception {}
function mapGenerator(array $arr, $callback)
{
$ret = [];
foreach ($arr as $val) {
try {
yield $callback($val);
@emrahoruc
emrahoruc / MySql_command_lines.sql
Last active April 14, 2022 20:26
MySql Some Command linses
# Export
mysqldump -u root site_database > /home/sitename/BCKP001.sql
mysqldump -u root site_database | gzip > /home/sitename/BCKP001.sql.gz
# Ignore specific table
mysqldump -u root site_database --ignore-table=site_database.table1 > /home/sitename/BCKP001.sql
# Export specific table
mysqldump -u root site_database table1 > /home/sitename/BCKP001.sql
# Import
@emrahoruc
emrahoruc / jsonInDom.php
Created August 21, 2017 07:24
json in the HTML attribute
<div data-secret="<?= htmlspecialchars(json_encode($data), ENT_QUOTES, 'UTF-8') ?>">
Look at inside me!
</div>