Skip to content

Instantly share code, notes, and snippets.

View ip413's full-sized avatar
🇵🇱

ip413 ip413

🇵🇱
View GitHub Profile
@ip413
ip413 / static_server.js
Last active July 6, 2016 20:26 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
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);
@ip413
ip413 / ffind
Last active August 24, 2016 11:45
#!/bin/bash
# Alias which allow to "fast" find in current dir.
# Defaults:
# - directory: current
# - case: ignore
find . -iname "*$1*"
#!/usr/bin/ruby
if ARGV.length == 0
puts <<HELP
Script extracts Kindle Clippings for specified book into external file, with formatting:
=== location 340
Clipping content xyz
=== page 450
@ip413
ip413 / reset-permissions.sh
Last active November 28, 2016 13:48
Recursively resets permissions for current folder and all files inside it to 755 and 644
#!/bin/bash
# Recursively resets permissions for current folder and all files inside it to 755 and 644.
# No file will be executable.
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
@ip413
ip413 / resize-video.sh
Last active December 2, 2020 07:32
Resize video to 720p MP4 with sharpen effect
#!/bin/bash
if [ -z "$1" ]
then echo "
File name to process required. File name shouldn't contain any whitespace chars.
If you want to limit cpu use for example:
cpulimit -e ffmpeg -l 200 # every thread has 100 'points'
"
else
# This line is used for testing small chunks of the file
@ip413
ip413 / compress-jpg.sh
Last active December 8, 2016 15:10
Bash script for recursive compress of jpg files
#!/bin/bash
if [ -z "$1" ] || [ -z "$2" ]
then echo "
Usage: script [directory] [quality] [change files]
Requirements: ImageMagic (convert, identify), jpegoptim
Arguments:
directory - script take all jpg files from directory
quality - jpg quality value (0-100); if file has higher quality will be processed lossy, otherwise lossless
@ip413
ip413 / compress-png.sh
Last active December 8, 2016 15:09
Bash script for recursive optimization png files
#!/bin/bash
if [ -z "$1" ]
then echo "
Usage: script [directory] [change files]
Arguments:
directory - script take all jpg files from directory
change files - if true files will be changed, otherwise (default) then will not change any files (test run)
Requirements: optipng
@ip413
ip413 / index.html
Last active May 26, 2021 10:41
App verison number generator from date and git commit hash
<html>
<head>
</head>
<span>
__APP_VERSION__
</span>
</html>
@ip413
ip413 / AccessDump.py
Created May 30, 2017 09:14 — forked from mywarr/AccessDump.py
use mdbtools to convert .mdb to .sqlite and .csv
#!/usr/bin/env python
#
# AccessDump.py
# A simple script to dump the contents of a Microsoft Access Database.
# It depends upon the mdbtools suite:
# http://sourceforge.net/projects/mdbtools/
import sys, subprocess, os
DATABASE = sys.argv[1]