...
WebSocket using Node Socket.io Notes

My previous experience with websockets involved a server running on Ruby on a linux server and Chrome setting up the WebSocket object allowing two way interaction between client and serverRubyruby is version 2 and capable of running the websockets server ruby 200p648 20151216 x8664linux and my previous experience also showed that you can connect to MySQL via ruby However after some research it may not be the best optionPHPPHP is able to run a websocket server but I found that it is not a good option because it uses a lot of server resources Since that was the origin of the issues I did not look into this solution any further It also used php S as the server which is suggested in the PHP manual to not use in a production environmentPythonPython was my next step as I have more experience programming in Python than I do in ruby however Pythons websockets library uses python 3 There are a most likely lot of native linux programs that use the installed python version 2718 that makes me not want to use this option The jump to Python3 is not backwards compatible The solution to this is to have both Python2 and Python3 in the same box Every time Ive done this in the past has been met with many problems some of the with the OS itselfOn the offchance Python would be an option I upgraded my linux server to Ubuntu 2004 which comes standard with Python3 I created a test

Read More
...
My workflow to converting and optimizing video files between servers

There has been a command that Ive wanted in my command line fu arsenal for many years and only have gotten around to do it today I figured I would share Quick rundown about my setup and what in turn creates my problem I have one server which is Ubuntu and acts more as a local web and file server for my internal projects It has libav ffmpeg or avconv installed and it works but it is mighty slow Hardware related Im sure the computer was freeThen I have an old Power Mac G5 that is older than the Ubuntu but works about 4 times faster than the Ubuntu in processing power It also has 4 times the cores so that would make some mathematical sense Ubuntu will slow down encoding to about 9 frames a second while the mac will cruse at 40 or 50 depending on bitrateIf you know me or have seen any of my outlets youll know I have too many hobbies and I try to film them all This leaves me with a lot of mixed video files all over my local Ubuntu server I have network access samba smbd to a drive on the Ubuntu server so I can use premiere and connect to the drive If the video files are small enough that I dont have to move any video around This is very helpful But if the video files are too large editing is almost impossible and when it comes time to mixdown

Read More
...
Find and remove commercials from recorded tv shows

Just say you wanted to remove some commercials from some legally obtained tv shows For instance you use your DVR to record some tv shows you really like so you can watch them later You didnt like just scrape some transport streams from a very commercialheavy provider and want to remove the pesky commercials for banks that allow you to overdraft your account with no fees or whether or not a Mexican beer really helped someone realize their dream to be barber or an EDM DJ Im still working on that career change BTW Im digressingI have these transport streams that end in ts but they contain the commercials as well Seems I dont know everything about ts but it looks like the audio and video is programmatically timed My attempts to pull them into Premiere and remove the commercials worked but when encoded the sound fell out of sync a few seconds So it doesnt seem to be completely related as it wasnt 2 minutes out of sync but in either case thats a lot of work for poopy resultsHeres the workflow that I found works AND can be automated1 Encode the ts into mp4 with the commercialsI feel like this smashes the video and audio together and locks it into place My first and normal attempt was with ffmpeg and my second was with handbrake Since Im attempting to automate this process for the 140 episodes I er DVRd this is using ffmpeg older versions needed the strict flag

Read More
...
Switch Your Linux Servers to Public Key Authentication

Public Key AuthenticationI have been told through the years to always do this but Ive always had to research how every time Ive had trouble finding an endtoend tutorial so I wind up needing to search out all of the parts I have put together the path I take the shortest route to get this accomplished and secure my servers I dont know about you but my severs are constantly getting hit by bots trying to break in through the sshd passwordI sometimes like to watch authlog and pretend its my apache accesslog so that I had trafficThis is important Doing this in the wrong order or not knowing what youre doing can lock you out of your server Ive done it Its unpleasant I have a step that assures this works before you loose you connectionClient ComputerMy client computers are MacBooks and the remote server is Ubuntu If you have Windows then youre out of luck with this tutorial If this makes you mad contact me Ill update it First thing is to open up a terminal window and log into your remote server using the password This is your backup window so if things go South you can undo your config changesI like to tail the syslog to see if any bots try to log in in the process This terminal keep open in the background as your backupNext you need a key On your client computer mac open up another terminal window and cd to the UsersYourNamessh folder

Read More
...
Making web request in c#

.NET fiddle web request curl c# php simple linux file_get_contents() libraries System.Net.Http

Read More
...
Call CL or RPGLE program in IBM iSeries via Stored Procedure

Making a stored procedure in the IBM iSeries world takes a few steps in the way I was taught Normally for our production environment we would use a version control product called Aldon The way Im going to show you uses IBMs PDM to create a text file for DB2 to read and then you run the query to create your stored procedure by running that text file through DB2First thing youre going to do is start up PDM and start a new DROP PROCEDURE FREDDYLIBE1QPROC create procedure FREDDYLIBE1QPROC IN PCUST NUMERIC7 IN PUSER CHAR LANGUAGE RPGLE DETERMINISTIC NO SQL EXTERNAL NAME WBLIBE1CREINDEX PARAMETER STYLE GENERAL This example I used to call an RPG program directly You could also call a CL by swapping out the RPGLE with CL The NO SQL will make a difference if you plan to use SQLRPGLE or any other kinds of SQL in your program change The NO SQL effectively stops any SQL from happening You can simply omit it I normally leave it off so I dont have issues later if I add SQL down the road as I normally will program using embedded SQL in SQLRPGLE so SQL is always available

Read More
...
RGP Hello World Tutorial

When I started working for my current employer I was sat at an iSeries command line I really struggled in the beginning with finding a good set of tutorials to show me some of the basic beginner stuff Its been 5 years since then and RPG has changed to a new format called freeform or free format RPG I have written numerous programs and scripts in the greenscreen native languages now Being from an open source background and knowing that a lot of RPGers out there are trying to learn PHP I figured I could put together some crossreference tutorials that can be used by both partiesThis tutorial will also include the way Ive learned to compile on the side We use a version control system called Aldon in the greenscreen that manages our deployment I wont be going into Aldon but a lot of the commands and interfaces are the same I will be using a program called PDM which stands for Program Development Manager Where objects live vs files in PHPThe way that I learned how to manage what I would call files are called members in IBM world Members live in objects and objects live in libraries Only for the sake of simplicity you could say that a library is like a drive an object is like a directory and a member is like a file This is not correct at all just an easy way to get the nomenclature This is how it loosely works vs a

Read More
...
Making an HTML5 table from an associative array in PHP - an easy tutorial

Hi there Many times I am faced with a bunch of data that I need to make into a table Usually my data is in a database but there are times in which I am making a website and need to store some data but dont have a database available Making tables is kind of a drag but making programming datastructers are not as bad Arrays are some of the most common types of datastructures youre going to run across in most programming languages The are basically variables that hold of information A simple array in PHP could be defined like thismyArray ArraydogssnackswagonscrackersThats what it would look like in the code In PHP you can use the built in function printrmyArray to print that puppy outphp echo printrmyArray would output this Array dogs 1 snacks 2 wagons 3 crackers

Read More
...
Make a PHP directory to list out all the images from a directory

I wrote this a long time ago and have been adding little simple bits to it along the way Drop this script into a directory on a server and then navigate to it in your favorite browser to it and youll get a list with thumbnails of all of your images All other files that are not images will show up as broken links Ill probably fix that somedaytable trphpi0dir handle opendirdirwhilefile readdirhandle iffile file is getimagesizefile center a hrefphp echo file targetblank img srcphp echo file php ifis0200 width200php border0 Br php echo file php echo is0xis1 tdphp ifi4i0 trphp else i

Read More
1
2
3