This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTML5: | |
<a class="clicker" data-mynumber="311">Click</a> | |
JQUERY: | |
$('.clicker').attr('data-mynumber'); | |
// returns 311 | |
$('.clicker').data('mynumber'); | |
// returns 311 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From rfc3986: | |
As the "first-match-wins" algorithm is identical to the "greedy" | |
disambiguation method used by POSIX regular expressions, it is | |
natural and commonplace to use a regular expression for parsing the | |
potential five components of a URI reference. | |
The following line is the regular expression for breaking-down a | |
well-formed URI reference into its components. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iptables -t mangle -A timedredirection -m time --timestart 06:00:00 --timestop 21:00:00 -j RETURN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
With bash, if you want to embed newlines in a string, enclose the string with $'': | |
$ list="One\ntwo\nthree\nfour" | |
$ echo "$list" | |
One\ntwo\nthree\nfour | |
$ list=$'One\ntwo\nthree\nfour' | |
$ echo "$list" | |
One | |
two | |
three |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Base 36 to Integer: | |
intval($str,36) | |
Integer to Base 36: | |
base_convert($val, 10, 36) | |
So then, instead of redirecting to a route like /url/1234 it becomes /url/ax instead. | |
This gives you a whole lot more use than a hash will, as there will be no collisions. | |
Don't hash, use other bases for this kind of thing. (It's faster and can be made collision-proof.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# convert pdf to high resolution image | |
convert -density 1200 page.pdf -resample 300 page.jpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Keybindings | |
C-a tab - switch input focus to the next region. | |
C-a Q - remove all regions but the current one. | |
C-a S - split the current region horizontally into two new regions. | |
C-a X - remove the current region. | |
C-a | - split the current region vertically into two new regions. | |
Focusing Regions | |
The focus command is relatively simplistic. Even though regions may be laid out in a two-dimensional space, screen maintains them internally as a simple list, and focus simply moves forwards or backwards through the list. (There are also focus subcommands to jump to the beginning of the list–the upper-leftmost region–and to the end of the list–the lower rightmost region.) The order is pretty intuitive, and it's easier to tell you to try it out than to try to describe it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Written by Thanos Apostolou | |
http://askubuntu.com/questions/53822/how-do-you-run-ubuntu-server-with-a-gui | |
Some more info can be found here https://help.ubuntu.com/community/ServerGUI. I assume you start with a clean install of Ubuntu Server 16.04 (some modifications may be needed for older versions of Ubuntu). Depending on your needs you can do these: | |
Minimal GUI: | |
sudo apt install xorg | |
sudo apt install --no-install-recommends openbox | |
Run the command startx and openbox will start (you can open a terminal there and run any application you want) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS C:\WINDOWS\system32> Set-ExecutionPolicy RemoteSigned | |
PS C:\WINDOWS\system32> $UserCredential = Get-Credential | |
PS C:\WINDOWS\system32> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection | |
PS C:\WINDOWS\system32> Import-PSSession $Session | |
PS C:\WINDOWS\system32> New-DistributionGroup -PrimarySmtpAddress {distro_email_address} -Name "{my distro group}" -Members {list_of_recipients_email_addresses,comma,separated} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# src: https://www.iplocation.net/traffic-control | |
# | |
# tc uses the following units when passed as a parameter. | |
# kbps: Kilobytes per second | |
# mbps: Megabytes per second | |
# kbit: Kilobits per second | |
# mbit: Megabits per second | |
# bps: Bytes per second |
OlderNewer