Skip to content

Instantly share code, notes, and snippets.

Andrius Putna fordnox

  • Kaunas, Lithuania
Block or report user

Report or block fordnox

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View test.php
<?php
echo date('c');
?>
@fordnox
fordnox / index.html
Created Apr 2, 2019
this is an example of index pafge
View index.html
<!DOCTYPE html>
<html>
<body>
<?php
echo "This is a very simple php example.";
?>
</body>
</html>
@fordnox
fordnox / index.php
Last active May 14, 2019
this is an example of index pafge
View index.php
<!DOCTYPE html>
<html>
<body>
<?php
echo "This is a very simple php example.";
?>
</body>
</html>
@fordnox
fordnox / crop.sh
Created Jan 24, 2019
crop resize sharpen with image magic
View crop.sh
convert *.png -set filename:base "%[basename]" -crop 2048x2048+0+0 -resize 640x640 -sharpen 0x1 res/"%[filename:base].png"
@fordnox
fordnox / flac2mp3.sh
Created Aug 26, 2018
flac to mp3 converter
View flac2mp3.sh
#!/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 Apr 5, 2017
Check ftp connection with PHP
View check-ftp.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 Mar 21, 2017
universal mina deploy script
View deploy.rb
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*
View id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCtoCHKm+G/ywvZvNkhXzUYXVLJGl6FYt+0dizFvcUNRsZmNZHjicBqOyAIRI4OSaACuMhaNJ9oakMLuZhdJxKETTZhRLmokRDgiTDBwItBLpM6NeLeFLpvj51vPllV6wqv6ybIb6sH3nuUkkeDrdkTOGB0uTXKKeU0ggzSWwUTEURQ6JdiQOgylmZ0WtK0PFjPykgDdikY/mGvKytgX2TizdMqbhF8YNuViRpV398QB+FFPkspm2jSpRAs7uEg53I14L1jde6NEJJMraIHSK5EnqFpJRRD+zc8VZ2+8jGtV6onQ9s+9kqPes7JyshkZwcndlT5539WJZ/Js1SHaH6Z fordnox
@fordnox
fordnox / plugin-enabler.sh
Created Dec 15, 2016
Enable cache plugin for wordpress
View plugin-enabler.sh
#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
View static_server.js
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
You can’t perform that action at this time.