Skip to content

Instantly share code, notes, and snippets.

View vladdancer's full-sized avatar
🖖

Vlad Moyseenko vladdancer

🖖
View GitHub Profile
@vladdancer
vladdancer / analyze_js_bundle_size.sh
Created December 13, 2020 20:44
Analyze JS bundle size
source-map-explorer public/build/bundle.js public/build/bundle.js.map
@vladdancer
vladdancer / macos_logout_user.sh
Created December 12, 2020 11:26
Lgout user using shell on macos.
sudo launchctl bootout user/$(id -u USERNAME)
@vladdancer
vladdancer / fast_copy_node_proj.sh
Created December 7, 2020 10:46
Copy node project without node_modules #node #js #bash
rsync -av --progress ../source_proj/* ./ --exclude node_modules --exclude .git
@vladdancer
vladdancer / Remove audio track from video.sh
Last active February 5, 2021 16:27
FFmpeg converting m4a, wav files to mp3 examples.
# show media file info
ffmpeg -i in.mp4
# find video track ID and set as -map param value
ffmpeg -i in.mp4 -map 0:0 -vcodec copy out-wo-audio.mp4
@vladdancer
vladdancer / App.svelte
Last active January 18, 2021 17:36
workaround for a bug with hiding view toolbar on specific page on #framework7 #v5
<script>
import {
App,
View,
Toolbar,
Views,
Link, f7ready
} from 'framework7-svelte';
import {states} from "./services/store";
@vladdancer
vladdancer / drush.ev.sh
Created October 30, 2020 18:35
Set TTL for file deletion #drupal
drush cset system.file temporary_maximum_age 1 -y
@vladdancer
vladdancer / export.single.config.sh
Created October 28, 2020 12:40
Export list of single config files using Drupal Console
#!/bin/bash
# get a list of config ids that we are interested in.
drupal dc | grep 'views.view.phot*'
drupal ces \
--module=MY_MODULE \
--optional \
--remove-uuid \
--remove-config-hash \
@vladdancer
vladdancer / domain.conf
Last active November 3, 2020 14:39
NGINX https config for a single domain with PHP app on Debian 10 using Letsencrypt certificate
server {
listen 443 ssl http2;
server_name example.com;
root /var/www/app;
index index.php index.html index.htm;
ssl on;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
@vladdancer
vladdancer / fix_entity_type_after_removing_entity_key.drush.php
Last active October 9, 2020 22:14
Fix entity type after removing entity key. #drupal8 #drupal #entity #drush
<?php
/**
* For the details see https://www.drupal.org/project/drupal/issues/3058082
* Run with:
* `drush scr fix_entity_type_after_removing_entity_key.drush entity_type -- YOUR_ENTITY_TYPE_NAME entity_key -- KEY_TO_REMOVE`
* How to run php script with Drush on Drupal see `drush scr --help`.
*/
if ($extra[0] !== 'entity_type' || !isset($extra[1])) {
print "You should provide 'entity_type' argument\n";
@vladdancer
vladdancer / certbot.cron
Created October 8, 2020 10:38
Debian 10 Certbot cron task to prolongate certificate
#Ansible: Certbot automatic renewal.
*/3 * * * * (/opt/certbot/certbot-auto renew --quiet --no-self-upgrade --pre-hook "/bin/systemctl stop nginx" --post-hook "/bin/systemctl start nginx") >> /var/log/certbotcron.log 2>&1