Skip to content

Instantly share code, notes, and snippets.

👋
Hi

Dhaya dhayab

👋
Hi
Block or report user

Report or block dhayab

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
@dhayab
dhayab / index.html
Last active Aug 14, 2018
WebSocket Logger
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>WebSocket Logger</title>
<link rel="stylesheet" href="https://dhayab.github.io/luxafor-webusb/demo.css">
<style>
.console .log a {
@dhayab
dhayab / FtpLog.sh
Created Mar 24, 2018
Collection of miscellaneous scripts and files used in my old Netgear ReadyNAS Duo V2 NAS.
View FtpLog.sh
##
# Display colored FTP access and transfer log
##
#!/bin/bash
PATTERN="User (.*): Login successful|/home/ftp/([a-z0-9\/._-\&\(\)]{1,})|FTP session closed"
sudo tail -n 100 -f /var/log/proftpd.log | egrep -i "$PATTERN" --color=auto
@dhayab
dhayab / makeswap.sh
Created Oct 21, 2015
Creates a swapfile and sets specific parameters on Ubuntu-based cloud VMs.
View makeswap.sh
#!/bin/bash
#
# Info: Creates a swapfile and sets specific parameters on Ubuntu-based cloud VMs.
# Tested with Ubuntu 14.04 on DigitalOcean.
# Based on: https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04
SIZE=1G
FILE=/swapfile
if [ "$EUID" -ne 0 ]
@dhayab
dhayab / Default (OSX).sublime-keymap
Last active Oct 21, 2015
My Sublime Text 3 preferences and key bindings.
View Default (OSX).sublime-keymap
[
// Change key binding to open console on non-qwerty keyboards
{ "keys": ["ctrl+&"], "command": "show_panel", "args": { "panel": "console", "toggle": true } },
// Swap lines
{ "keys": ["alt+up"], "command": "swap_line_up" },
{ "keys": ["alt+down"], "command": "swap_line_down" },
// Code folding
{ "keys": ["ctrl+shift+keypad_plus"], "command": "unfold_all" },
{ "keys": ["ctrl+shift+keypad_minus"], "command": "fold_all" },
// Fix Beginning + End of line
@dhayab
dhayab / keybase.md
Created Mar 6, 2014
keybase.io proof of my github identity
View keybase.md

Keybase proof

I hereby claim:

  • I am dhayab on github.
  • I am dhaya (https://keybase.io/dhaya) on keybase.
  • I have a public key whose fingerprint is E849 877A ADC4 E5C6 7A41 BB74 CA98 A8F6 815E DAAE

To claim this, I am signing this object:

@dhayab
dhayab / filters.php
Last active Jan 25, 2016
Laravel persistent language prefixing
View filters.php
<?php
App::before(function($request))
{
if ( in_array(Request::segment(1), Config::get('app.languages')) ) {
Session::put('locale', Request::segment(1));
} else {
return Redirect::to(Config::get('app.locale'));
}
if ( Session::has('locale') ) {
View gist:5967162
# Rewrite for content.
if (!-d $request_filename) {
rewrite ^/(.+)/$ /$1 permanent;
}
location ~* \.php$ {
@dhayab
dhayab / gist:5715152
Last active Dec 18, 2015 — forked from jacekd/gist:4562959
Get language prefixing in URLs from Laravel 3 back into Laravel 4.
View gist:5715152
<?php
/*
* Multilingual URLs in Laravel 4
*/
//config/app.php
return array(
...
You can’t perform that action at this time.