Skip to content

Instantly share code, notes, and snippets.

View yboujraf's full-sized avatar

Boujraf Youssef yboujraf

View GitHub Profile
@yboujraf
yboujraf / README.md
Created October 27, 2019 17:26 — forked from hwdsl2/README.md
My IPTables rules for securing the Asterisk VoIP server
@yboujraf
yboujraf / net.js
Created December 20, 2019 01:09 — forked from sid24rane/net.js
Simple TCP Client and Server in Node.js (Covering all useful Properties & Methods)
var net = require('net');
// creates the server
var server = net.createServer();
//emitted when server closes ...not emitted until all connections closes.
server.on('close',function(){
console.log('Server closed !');
});
@yboujraf
yboujraf / udp.js
Created December 20, 2019 01:10 — forked from sid24rane/udp.js
Simple UDP Client and Server in Node.js ==> ( Echo Server )
var udp = require('dgram');
// --------------------creating a udp server --------------------
// creating a udp server
var server = udp.createSocket('udp4');
// emits when any error occurs
server.on('error',function(error){
console.log('Error: ' + error);
@yboujraf
yboujraf / capture_raw_frames.c
Created December 31, 2019 09:44 — forked from maxlapshin/capture_raw_frames.c
v4l2 capture example
/*
* V4L2 video capture example
*
* This program can be used and distributed without restrictions.
*
* This program is provided with the V4L2 API
* see http://linuxtv.org/docs.php for more information
*/
#include <stdio.h>
@yboujraf
yboujraf / capture_raw_frames.c
Created December 31, 2019 09:44 — forked from maxlapshin/capture_raw_frames.c
v4l2 capture example
/*
* V4L2 video capture example
*
* This program can be used and distributed without restrictions.
*
* This program is provided with the V4L2 API
* see http://linuxtv.org/docs.php for more information
*/
#include <stdio.h>
@yboujraf
yboujraf / rpi-cpuinfo-dt.md
Created January 14, 2020 10:27 — forked from jperkin/rpi-cpuinfo-dt.md
raspberry pi cpuinfo vs device-tree

Raspberry Pi cpuinfo vs device-tree

My attempt at gathering information on how to detect exactly which Raspberry Pi model we are running on for https://github.com/jperkin/node-rpio. The goal is to come up with an optimal way of detecting the host across a wide range of hardware and OS.

Data

Name (Rev) cpuinfo /proc/device-tree/model device-tree/soc/ranges OS
B (1.0) 0002 Raspberry Pi Model B 7e000000 20000000 01000000 7
B (1.0) 0002 Raspberry Pi Model B Rev 1 7e000000 20000000 02000000 10
@yboujraf
yboujraf / rpi-cpuinfo-dt.md
Created January 14, 2020 10:27 — forked from jperkin/rpi-cpuinfo-dt.md
raspberry pi cpuinfo vs device-tree

Raspberry Pi cpuinfo vs device-tree

My attempt at gathering information on how to detect exactly which Raspberry Pi model we are running on for https://github.com/jperkin/node-rpio. The goal is to come up with an optimal way of detecting the host across a wide range of hardware and OS.

Data

Name (Rev) cpuinfo /proc/device-tree/model device-tree/soc/ranges OS
B (1.0) 0002 Raspberry Pi Model B 7e000000 20000000 01000000 7
B (1.0) 0002 Raspberry Pi Model B Rev 1 7e000000 20000000 02000000 10
@yboujraf
yboujraf / baseConverter.js
Created March 29, 2020 03:58 — forked from faisalman/baseConverter.js
Convert From/To Binary/Decimal/Hexadecimal in JavaScript
/**
* Convert From/To Binary/Decimal/Hexadecimal in JavaScript
* https://gist.github.com/faisalman
*
* Copyright 2012-2015, Faisalman <[email protected]>
* Licensed under The MIT License
* http://www.opensource.org/licenses/mit-license
*/
(function(){
@yboujraf
yboujraf / certbot.sh
Created April 17, 2024 23:52 — forked from fideloper/certbot.sh
Certbot on Ubuntu, wildcard subdomains via CloudFlare DNS challenge
# Used on Ubuntu 18.04 and 20.04
# Find instructions for other OSes here: https://certbot.eff.org/instructions
# Install Certbot via Snaps
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
# Install DNS CloudFlare plugin
sudo snap set certbot trust-plugin-with-root=ok