Skip to content

Instantly share code, notes, and snippets.

Michael Dayah Lucent

Block or report user

Report or block Lucent

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Lucent
Lucent / .block
Last active Apr 3, 2019 — forked from alisd23/.block
D3v5 Dependencies Graph
View .block
height: 750
@Lucent
Lucent / generate_passwords.php
Created Dec 9, 2018
Removing ambiguous characters is the same as never including them
View generate_passwords.php
<?php
$LENGTH = 4;
$SAMPLES = 100000;
$all = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$ambig = ["l","1","I","o","O","0"];
$unambig = str_replace($ambig, "", $all);
function generate_passwords($remove, $set, $length, $samples) {
global $ambig;
$numbers_yes = 0;
View Verifying my Peepeth
Verifying my identity on Peepeth.com 0x4e6dddefc6047242128697caf28bdfec6c845337
@Lucent
Lucent / bash_utilities.sh
Last active Aug 24, 2018
Useful bash one-liners
View bash_utilities.sh
# Remove all empty folders
find . -maxdepth 1 -type d -empty > empty.txt; rmdir $(<empty.txt)
# Remove empty folders 2 levels deep, and their parent
find . -maxdepth 2 -type d -empty > empty.txt; rmdir $(<empty.txt)
find . -maxdepth 1 -type d -empty > empty.txt; rmdir $(<empty.txt)
# Move all folders with certain name into their own named folder
find -maxdepth 2 -name 'lavajava' -printf '%h\n' > lavajava.txt; mkdir lavajava; mv $(<lavajava.txt) lavajava/
@Lucent
Lucent / journal_search.php
Created Aug 19, 2018
Search and cleanup LiveJournal entries
View journal_search.php
<?php
if ($_GET["password"] != "password") { ?>
<p>Private search feature. Intrusion logged.</p>
<?php
return; }
set_time_limit(300);
$journal_dir = "C:\documents and settings\michael dayah\my documents\lj backup";
$username = "lucent";
$entry_array = array ();
@Lucent
Lucent / cd_interest.php
Last active Aug 21, 2018
Calculate CD interest over term
View cd_interest.php
<?
setlocale(LC_MONETARY, "en_US");
$cd_list = array(
array("Principal" => 250000, "Interest" => 5.05, "Start" => "27 Apr 2007", "Term" => "6 months", "Interest Term" => "6 months"),
array("Principal" => 250000, "Interest" => 5.10, "Start" => "27 Apr 2007", "Term" => "9 months", "Interest Term" => "9 months"),
array("Principal" => 250000, "Interest" => 5.20, "Start" => "27 Apr 2007", "Term" => "12 months", "Interest Term" => "6 months"),
array("Principal" => 250000, "Interest" => 5.00, "Start" => "27 Apr 2007", "Term" => "90 days", "Interest Term" => "90 days")
);
$total = 0;
@Lucent
Lucent / logprism.pl
Created Aug 18, 2018
Custom logprism for Ptable
View logprism.pl
#!/usr/bin/perl -w
#=============================================================================
#
# Copyright (C) 2005 - 2007, Matti Tukiainen, http://ktmatu.com/mt/
#
# Program name : LogPrism (logprism.pl)
# Version : 2.03
# Purpose : LogPrism turns Apache access log files (combined) into
# easy to read color highlighted format where user
# sessions, error status codes, external referrers and
@Lucent
Lucent / spotify_library.txt
Last active Jan 10, 2019
Spotify library sorted by artist
View spotify_library.txt
https://open.spotify.com/track/316r1KLN0bcmpr7TZcMCXT
https://open.spotify.com/track/7pSJmBTlbA4S5zSLsj6Pzz
https://open.spotify.com/track/0ibdklhZmwLo3bzHqF435c
https://open.spotify.com/track/5q10Ov2JEbODDK2tk4NYWW
https://open.spotify.com/track/6rEr7AsF3cmfUR3birakRF
https://open.spotify.com/track/6ZOBP3NvffbU4SZcrnt1k6
https://open.spotify.com/track/0nNVR2iDM3eVzEgMi78vQm
https://open.spotify.com/track/5jzX4dWVQeBTtfBaXnMRt5
https://open.spotify.com/track/1hBM2D1ULT3aeKuddSwPsK
https://open.spotify.com/track/5gZyOr0V6OXt20bBHpm2nm
@Lucent
Lucent / language_count_locale
Created Aug 18, 2018
Count language codes with locale in logfile
View language_count_locale
cat /var/log/apache2/super.log | cut -d' ' -f10 | tr -d '"' | cut -d',' -f1 | sort | uniq -c | sort -nr
@Lucent
Lucent / language_count
Created Aug 18, 2018
Count language codes used in logfile
View language_count
cat /var/log/apache2/super.log | cut -d' ' -f10 | tr -d '"' | cut -d',' -f1 | cut -d'-' -f1 | sort | uniq -c | sort -nr
You can’t perform that action at this time.