Skip to content

Instantly share code, notes, and snippets.

View ayhanbaris's full-sized avatar
🏠
Working from home

Ayhan BARIS ayhanbaris

🏠
Working from home
  • istanbul
View GitHub Profile
@bloc97
bloc97 / TwoMethods.md
Last active February 20, 2024 12:19
Two Fast Methods of Generating True Random Numbers on the Arduino

Two Fast Methods of Generating True Random Numbers on the Arduino

Arduino true random number generator

B. Peng

December 2017

Abstract

The AVR series microcontrollers are a collection of cheap and versatile chips that are used in many applications ranging from hobbist projects to commercial infrastructure. One major problem for some hobbists is the lack of secure random number generation on the Arduino platform. The included pseudo-random number generator (PRNG) is very easy to defeat and is useless for any crypto-related uses. One recommendation from the Arduino Reference Manual is to use atmospheric noise from the chip's analog sensor pins as seed data[6].
Unfortunately this method is extremely weak and should not be used to emulate a true random number generator (TRNG). Existing methods such as using the internal timer drift or using a dedicated generator are either too slow, requires extensive external hardware or modifications to the microcontroller's internal mech

@tomysmile
tomysmile / mac-setup-redis.md
Last active March 18, 2024 22:12
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@hsiboy
hsiboy / animation.ino
Created January 9, 2015 16:39
FUNCTION-BASED ANIMATION SEQUENCES FOR WS2812 LED STRIPS Using FastLED library - Author: Dave Morris: http://www.google.com/+DaveMorris128
// FUNCTION-BASED ANIMATION SEQUENCES FOR WS2812 LED STRIPS
// Using FastLED library
// Author: Dave Morris: http://www.google.com/+DaveMorris128
// Version 1.0 (2014-07-31)
//
//
// The following code includes "primitive animations" which are the base effect and
// "aggregate animations" which are combinations of one or more primitive animations
// Feel free to combine different primitives each loop for synergistic results but:
// -If using an aggregate animation make sure your primatives don't clear the buffer each frame (FastLED.clear())
@jasny
jasny / linkify.php
Last active October 21, 2023 16:28
PHP function to turn all URLs in clickable links
<?php
/**
* Turn all URLs in clickable links.
*
* @param string $value
* @param array $protocols http/https, ftp, mail, twitter
* @param array $attributes
* @return string
*/
public function linkify($value, $protocols = array('http', 'mail'), array $attributes = array())
@dalethedeveloper
dalethedeveloper / gist:1042934
Created June 23, 2011 16:35
Backup bash script for Webserver DB + Site Files
#!/bin/bash
# http://www.ivorde.ro/How_to_backup_all_mysql_databases_with_one_command-51.html
# http://bash.cyberciti.biz/backup/backup-mysql-database-server-2/
# http://sgowtham.net/blog/2008/04/04/backing-up-and-restoring-mysql-databases/
# Requires: http://s3tools.org/s3cmd
MyUSER="YOUR-USERNAME"
MyPASS="YOUR-PASSWORD"
MyHOST="localhost"