Skip to content

Instantly share code, notes, and snippets.

View arkadiusjonczek's full-sized avatar
🏴‍☠️

Arkadius Jonczek arkadiusjonczek

🏴‍☠️
View GitHub Profile
@arkadiusjonczek
arkadiusjonczek / script.sh
Created June 3, 2018 23:32
List open ports on linux/unix #tags: linux
sudo lsof -i
sudo netstat -lptu
sudo netstat -tulpn
@arkadiusjonczek
arkadiusjonczek / query.sql
Created June 3, 2018 23:31
Select IDs from Tabel and create comma separated list as CSV #tags: MySQL
SELECT DISTINCT uid
FROM tt_news
ORDER BY uid
INTO OUTFILE '/tmp/uids.csv'
LINES TERMINATED BY ',';
@arkadiusjonczek
arkadiusjonczek / bash.sh
Created June 3, 2018 23:30
Absoluter Pfad einer Datei #tags: linux
readlink -f file.txt
@arkadiusjonczek
arkadiusjonczek / query.sql
Created April 25, 2018 14:21
MySQL Show Column Data Types #tags: MySQL
SELECT DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'oxarticles' AND COLUMN_NAME = 'OXID';
SELECT
COLUMN_NAME, DATA_TYPE
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
TABLE_SCHEMA = 'ods'
AND
@arkadiusjonczek
arkadiusjonczek / query.sql
Last active April 25, 2018 14:20
MySQL Show Database Used and Free Size #tags: MySQL
-- Query 1
SELECT
sum(round(((data_length + index_length) / 1024 / 1024 / 1024), 2)) as "Size in GB"
FROM
information_schema.TABLES
WHERE
table_schema = "ods"
-- Query 2
SELECT
@arkadiusjonczek
arkadiusjonczek / Xdebug.ini
Last active January 2, 2018 11:05
Enable Xdebug profiling #tags: PHP
xdebug.profiler_enable=1
xdebug.profiler_output_dir="/var/www/debug"
@arkadiusjonczek
arkadiusjonczek / git.sh
Created October 4, 2017 22:26
Delete git tag and push a new one #tags: git
# remove tag 1.1
git tag -d 1.1
git push origin :refs/tags/1.1
# tag current and push to origin
git tag 1.1
git push origin 1.1
@arkadiusjonczek
arkadiusjonczek / .htaccess
Last active July 18, 2018 09:11
301 Redirect all requests to another Domain #tags: Apache, SEO
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ http://domain.de [R=301,L]
</IfModule>
@arkadiusjonczek
arkadiusjonczek / copy-ssh-public-key.sh
Last active November 10, 2018 04:44
Copy SSH Public Key #tags: SSH, bash
cat ~/.ssh/id_rsa.pub | pbcopy
@arkadiusjonczek
arkadiusjonczek / snippet.sql
Created September 29, 2017 15:03
[MySQL] IDs as comma separated list #tags: OXID, MySQL
SELECT GROUP_CONCAT(OXID) FROM oxarticles LIMIT 100