Skip to content

Instantly share code, notes, and snippets.

View mihaikelemen's full-sized avatar
:octocat:
<online />

Mihai KELEMEN mihaikelemen

:octocat:
<online />
View GitHub Profile
@mihaikelemen
mihaikelemen / Clone Vagrant
Last active February 15, 2024 06:39
Clone exiting Vagrant box (with VirtualBox) on Ubuntu
`VBoxManage list vms` #lists all vm present on the current machine
`vagrant package --base ubuntu_1804_php56_default_1606497717410_71168 --output ~/vagrantbox.box` # save box
`vagrant init ubuntu_1804_php56_default_1606497717410_71168 ~/vagrantbox.box` #import box
@mihaikelemen
mihaikelemen / app.js
Created January 14, 2023 07:49 — forked from prof3ssorSt3v3/app.js
PWA 6 - Handling Install Events
const APP = {
deferredInstall: null,
init() {
if ('serviceWorker' in navigator) {
//register our service worker
navigator.serviceWorker
.register('/sw.js', {
updateViaCache: 'none',
scope: '/',
})
@mihaikelemen
mihaikelemen / configuration.yml
Created April 20, 2019 07:15
Redmine - Amazon SES (Simple Email Service) configuration
...
email_delivery:
delivery_method: :smtp
smtp_settings:
enable_starttls_auto: true
address: "AWS_SMTP_DOMAIN"
port: 587
domain: "REDMINE_DOMAIN"
authentication: :login
user_name: "YOUR_SMTP_USER"
@mihaikelemen
mihaikelemen / change_db_collation.sh
Last active April 3, 2022 09:23
Small utility to change a database collation & character set
#!/bin/bash
DB_USER="" # your database user
DB_PASSWORD="" # your database password
DB_NAME="" # your database name
CHARACTER_SET="utf8mb4" # your default character set
COLLATE="utf8mb4_unicode_ci" # your default collation
mysql -u $DB_USER -p$DB_PASSWORD -e "ALTER DATABASE `$DB_NAME` CHARACTER SET = $CHARACTER_SET COLLATE $COLLATE;"
echo "$DB_NAME default collation changed to $COLLATE"
<?php
/**
* GitHub webhook handler template.
*
* @see https://developer.github.com/webhooks/
* @author Miloslav Hůla (https://github.com/milo)
*/
$hookSecret = 's.e.c.r.e.t'; # set NULL to disable check
@mihaikelemen
mihaikelemen / backup.sh
Last active February 3, 2019 10:45
A minimalistic backup tool for MySQL / MariaDB or files with auto-cleanup
#!/bin/bash
#
# A minimalistic backup tool for MySQL or files with auto-cleanup after a certain period, on a Ubuntu or Centos based environments.
# It can handle multiple projects (websites) located on the server where this tool is present. Add one or more *.conf files in the backup.d directory
# For each one of them we generate the md5 checksum.
#
# Requirements:
# - md5sum (usually present by default)
# - tar (usually present by default)
# - mysqldump (it comes with MySQL/MariaDB)