Skip to content

Instantly share code, notes, and snippets.

View oliworx's full-sized avatar

Oliver Kurmis oliworx

View GitHub Profile
@oliworx
oliworx / lets-automate-composer-updates.md
Last active September 20, 2023 20:54
Let's automate composer updates (my talk at the PHP user group Munich, September 2023)

Let's automate composer updates

automation comic
Image by Randall Munroe, xkcd.com


What are we talking about

  • Upgrading PHP packages only using composer
  • Packages following semantic versioning only
@oliworx
oliworx / .gitlab-ci.yml
Created September 18, 2023 09:16
How to semi-automate composer updated using GitLab CI
stages:
- update-dependencies
- code-style
- build
- test
- deploy
composer-update:
stage: update-dependencies
only:
@oliworx
oliworx / mysql-mariadb-table-size.sql
Created May 6, 2021 14:20
Get the size of MySQL/MariaDB tables
SELECT
TABLE_NAME AS `Table`,
ROUND((DATA_LENGTH ) / 1024 / 1024) AS `Data (MB)`,
ROUND((INDEX_LENGTH) / 1024 / 1024) AS `Index (MB)`,
ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `Total (MB)`
FROM
information_schema.TABLES
WHERE
TABLE_SCHEMA = "my_db_name"
ORDER BY
@oliworx
oliworx / rsync-homedir-excludes.txt
Created May 3, 2021 08:56
Filey to exclude when creating a backup of the home directory using rsync
# rsync-homedir-excludes
#
# A list of files to exclude when backing up *nix home directories using rsync.
#
# Author: Ruben Barkow-Kuder <https://github.com/rubo77/rsync-homedir-excludes>
# Version: 2019-11-30
#
# #Usage:
# USER=<homedir username here>
# rsync -aP --exclude-from=rsync-homedir-excludes.txt /home/$USER/ /media/$USER/linuxbackup/home/$USER/
@oliworx
oliworx / .profile
Last active June 12, 2020 08:46
shell alias for Laravel-Devs
alias gco='git checkout'
alias glg='git log'
alias gst='git status'
alias gbr='git branch'
alias grm='git rebase master'
alias gcom='git checkout master'
alias glo="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias dco='docker-compose'
alias dphp='docker-compose exec -u www-data app php'
{% if post.tags.size > 0 %}
Tag{% if post.tags.size > 1 %}s{% endif %}:
{{ post.tags | sort | join: ", " }}
{% endif %}
@oliworx
oliworx / git-cheat-sheet.md
Last active February 1, 2018 10:58
Git cheat sheet

Reset and sync local repository with remote branch

git fetch origin
git reset --hard origin/master
git clean -f -d

Your local branch is now an exact copy (commits and all) of the remote branch.

@oliworx
oliworx / HANA-tenant-db.sql
Created April 21, 2017 22:31
How to create and dropa SAP HANA tenant database
-- source: https://blogs.sap.com/2016/10/27/create-tenant-database-sap-hana-express-sap-hana-academy/
-- create a tenant
CREATE DATABASE TESTDB SYSTEM USER PASSWORD Initial1;
-- add the script server service
ALTER DATABASE TESTDB ADD 'scriptserver'
-- or hit two birds with one stone
CREATE DATABASE TESTDB ADD 'scriptserver' SYSTEM USER PASSWORD Initial1;
-- Tenants by default start automatically, but can be started and stopped manually as well
@oliworx
oliworx / fix-chrome-gnkome-keyring.sh
Created April 15, 2017 14:35
Fix the high CPU usage when starting Google chrome on Ubuntu Linux
#!/bin/sh
sudo chmod -x /usr/bin/gnome-keyring-daemon
@oliworx
oliworx / new-mysql-db-and-user.sql
Last active June 20, 2023 03:23
Create a New DB and User in MySQL
CREATE DATABAESE MYNEWDB;
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON MYNEWDB.* TO 'newuser'@'localhost';
FLUSH PRIVILEGES;