Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Vladimir Vukanac vukanac

🎯
Focusing
View GitHub Profile
@vukanac
vukanac / audi_mmi_mib2_2016_2017_ffmpeg_video_convert.sh
Last active Aug 11, 2021
ffmpeg shell command to convert all videos from my dir to acceptable Audi MMI format/size
View audi_mmi_mib2_2016_2017_ffmpeg_video_convert.sh
cd $HOME/my_funny_video
for i in *.mp4;
do name=`echo "$i" | cut -d'.' -f1`
echo "$name"
ffmpeg -hide_banner \
-i "$i" \
-r 25 \
-vf scale=w=720:h=404:force_original_aspect_ratio=decrease:force_divisible_by=2 ease \
-c:v libx264 \
@vukanac
vukanac / add_new_admin
Last active Jun 15, 2020 — forked from tridungpham/new_gist_file.sql
Create new admin user in Magento 1.9
View add_new_admin
export MAGE_FIRST_NAME="Peter"
export MAGE_LAST_NAME="Pan"
export MAGE_USERNAME="peter.pan"
export MAGE_PASS="topsecret1234"
make query QUERY="INSERT INTO admin_user SELECT NULL user_id, '$MAGE_FIRST_NAME' firstname, '$MAGE_LAST_NAME' lastname, '$MAGE_USERNAME@example.com' email, '$MAGE_USERNAME' username, MD5('$MAGE_PASS') password, NOW() created, NULL modified, NULL logdate, 0 lognum, 0 reload_acl_flag, 1 is_active, NULL extra, NULL rp_token, NOW() rp_token_created_at;"
make query QUERY="INSERT INTO admin_role SELECT NULL role_id, (SELECT role_id FROM admin_role WHERE role_name = 'Administrators') parent_id, 2 tree_level, 0 sort_order, 'U' role_type, (SELECT user_id FROM admin_user WHERE username = '$MAGE_USERNAME') user_id, '$MAGE_USERNAME' role_name;"
@vukanac
vukanac / authorize.ex
Created Apr 16, 2020 — forked from jeremytregunna/authorize.ex
After refactoring...
View authorize.ex
defmodule Api.Authorize do
alias Account.Models.User
alias Tracker.OrganizationMembers, as: OM
def board?(board_id, %User{} = user, available_perms, required_perms) do
with(
{:ok, board} <- Tracker.Board.find(board_id),
true <- OM.user_in_organization?(user.id, board.organization_id)
) do
required_perms == common_permissions(required_perms, available_perms)
@vukanac
vukanac / mfa-login.py
Created Mar 28, 2020
AWS Command Line MFA Login
View mfa-login.py
#!/usr/bin/env python3
import dateutil.parser, dateutil.tz, datetime, json, os, sys, boto3, stat
from subprocess import Popen, PIPE
# Get the profile, first argument on the command line
if (len(sys.argv) < 2):
raise Exception('Profile name not specified on command line')
profile = sys.argv[1]
@vukanac
vukanac / osx_bootstrap.sh
Created Mar 26, 2019 — forked from codeinthehole/osx_bootstrap.sh
Script to install stuff I want on a new OSX machine
View osx_bootstrap.sh
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twitter (app store)
View gist:190a339305313699cad9d3985cbbcf18
it('should refuse partial submissions', function(done) {
var browser = this.browser;
browser.fill('first_name', 'John');
browser.pressButton('Send').then(function() {
assert.ok(browser.success);
assert.equal(browser.text('h1'), 'Contact');
assert.equal(browser.text('div.alert'), 'Please fill in all the fields');
}).then(done, done);
});
@vukanac
vukanac / install-node8-mac-osx.md
Last active Aug 31, 2018
How to install node8 on mac osx 2017-08-20.
View install-node8-mac-osx.md

How to install node8 on mac osx

At an absolute minimum, you need to go into the home directories (the ones that start with ~/) and make sure you are okay with deleting the contents of those directories. If you are unsure if this will delete anything important, you should stop now and find another alternative for re-installing Node.js, because this approach is pretty destructive.