Skip to content

Instantly share code, notes, and snippets.

View fordnox's full-sized avatar
🍕
Eating pizza

Andrius Putna fordnox

🍕
Eating pizza
View GitHub Profile
@fordnox
fordnox / converter.sh
Created December 21, 2019 16:29
Convert image formats on MacOS
#!/bin/bash
#Convert all jpeg files in current dir to PNG in new folder Converted
sips -s format png *.jpeg –out Converted
#Convert all tiff files in current dir to jpeg in new folder Converted
sips -s format jpeg *.tiff –out Converted
<?php
echo date('c');
?>
@fordnox
fordnox / index.html
Created April 2, 2019 13:36
this is an example of index pafge
<!DOCTYPE html>
<html>
<body>
<?php
echo "This is a very simple php example.";
?>
</body>
</html>
@fordnox
fordnox / index.php
Last active May 14, 2019 11:41
this is an example of index pafge
<!DOCTYPE html>
<html>
<body>
<?php
echo "This is a very simple php example.";
?>
</body>
</html>
@fordnox
fordnox / crop.sh
Created January 24, 2019 20:12
crop resize sharpen with image magic
convert *.png -set filename:base "%[basename]" -crop 2048x2048+0+0 -resize 640x640 -sharpen 0x1 res/"%[filename:base].png"
@fordnox
fordnox / flac2mp3.sh
Created August 26, 2018 19:47
flac to mp3 converter
#!/bin/bash
for f in "$@"; do
echo "$f"
[[ "$f" != *.flac ]] && continue
album="$(metaflac --show-tag=album "$f" | sed 's/[^=]*=//')"
artist="$(metaflac --show-tag=artist "$f" | sed 's/[^=]*=//')"
date="$(metaflac --show-tag=date "$f" | sed 's/[^=]*=//')"
title="$(metaflac --show-tag=title "$f" | sed 's/[^=]*=//')"
year="$(metaflac --show-tag=date "$f" | sed 's/[^=]*=//')"
@fordnox
fordnox / check-ftp.php
Created April 5, 2017 13:17
Check ftp connection with PHP
<?php
$host = 'example.com';
$password = 'pass';
$username = 'username';
try {
$result = checkFtp($host, $username, $password);
} catch(Exception $e) {
$result = $e->getMessage();
}
@fordnox
fordnox / deploy.rb
Created March 21, 2017 13:32
universal mina deploy script
require 'mina/rsync'
set :user, ENV['USER'] || 'username'
set :domain, ENV['DOMAIN'] || 'foobar.com'
set :deploy_to, ENV['DEPLOY_PATH'] || '/tmp/deploy'
set :branch, ENV['GIT_BRANCH'] || 'master'
set :repository, ENV['GIT_REPO'] || '.'
set :rsync_options, %w[
--recursive --delete --delete-excluded
--exclude .git*
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCtoCHKm+G/ywvZvNkhXzUYXVLJGl6FYt+0dizFvcUNRsZmNZHjicBqOyAIRI4OSaACuMhaNJ9oakMLuZhdJxKETTZhRLmokRDgiTDBwItBLpM6NeLeFLpvj51vPllV6wqv6ybIb6sH3nuUkkeDrdkTOGB0uTXKKeU0ggzSWwUTEURQ6JdiQOgylmZ0WtK0PFjPykgDdikY/mGvKytgX2TizdMqbhF8YNuViRpV398QB+FFPkspm2jSpRAs7uEg53I14L1jde6NEJJMraIHSK5EnqFpJRRD+zc8VZ2+8jGtV6onQ9s+9kqPes7JyshkZwcndlT5539WJZ/Js1SHaH6Z fordnox
@fordnox
fordnox / plugin-enabler.sh
Created December 15, 2016 14:58
Enable cache plugin for wordpress
#install wp-cli on server https://github.com/wp-cli/wp-cli
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
#install cache plugin to wordpress
curl -O https://raw.githubusercontent.com/bluehost/endurance-page-cache/master/endurance-page-cache.php
#activate plugin