<html> <head> <title> Redirecting…</title></head> <script language=”JavaScript”> function redirectHttpToHttps() { var httpURL= window.location.hostname + window.location.pathname + window.location.search; var httpsURL= “https://” + httpURL; window.location = httpsURL; } redirectHttpToHttps(); </script> <body> </body> </html> nJoy 😉
Category: Howtos
List all mount binds
findmnt | grep “\[” nJoy 😉
Saving a mount in /etc/fstab for availability after reboot
UUID=de9a1ccd-a2dd-44f1-8be8-0123456abcdef /data ext4 defaults,nofail 0 or /dev/xvdf /data ext4 defaults,nofail 0 😉 nJoy
Saving a million documents in Mongo using Nodejs and mongodb module
/** * Created by davidsaliba on 13/03/2017. */ var MongoClient = require('mongodb').MongoClient , format = require('util').format; var url = 'mongodb://localhost:27017/test'; var async = require ('async'); var entry = { data : "skdlfjsdf", array : [ {id:"arr_obj1"} , {id:"arr_obj2"} ] }; var entries = []; var total_entries = 1000000 for (var j = 0 ; j…
Installing git on Debian 8.x
You should edit your sources.list , by adding the following line: deb http://ftp.ca.debian.org/debian/ jessie main contrib Then upgrade your package and install git: apt-get update && apt-get upgrade && apt-get dist-upgrade apt-get -f install apt-get install git nJoy 😉
Sending mp4 to a wowza with ffmpeg
ffmpeg -re -i video.mp4 -vcodec libx264 -vb 1500000 -g 60 -vprofile main -f flv rtmp://ingest.cix.domain.com:1935/live/231232 nJoy 😉
Create windows 10 boot disk on almost any linux host
Mount the ISO: sudo mount -t udf -o loop,ro,unhide /path/to/file.iso /mnt Insert the USB drive. Run fdisk and specify the device name of the USB drive; for example: sudo fdisk /dev/sdc Delete any existing partition table and create a new one. Create a new partition of at least 4.5 GB. Mark it bootable and set…
test Graylog GELF UDP input from Bash
for i in {1..100} ; do echo '{"version": "1.1","host":"david.org","short_message":"A short message that helps you identify what is going on","full_message":"Backtrace here\n\nmore stuff","level":1,"_user_id":9001,"_some_info":"foo","_some_env_var":"bar"}' | nc -w 1 -u graylog.mydomain.com 12201 ; done nJoy 😉
Script to verify that a path is synchronized across multiple machines via ssh
This is a script I wrote for work to look through a number of remote servers via ssh (shared keys or include a .pem (id_rsa) file to compare a paths and all it’s subfolders. The result is a report of which files are out of synch and if duplicates found they are listed separately. #!/bin/bash…
Reviving dead Centos 4 repos
Edit /etc/yum.repos.d/CentOS-Base.repo Comment out the “mirrorlist” entries. Uncomment the “baseurl” entries and change them to http://vault.centos.org/4.9/os/$basearch nJoy 😉