glyph | named entity | numeric entity | escaped unicode |
---|---|---|---|
“ | “ | “ | \201C |
” | ” | ” | \201D |
‘ | ‘ | ‘ | \2018 |
’ | ’ | ’ | \2019 |
#Christmas Tree
<?php
if($a) {
if($b) {
if($c) {
if($d) {
// This is what I really want to do
} else {
//Do something something else
function loadStyleSheet(src) {
if(document.createStyleSheet) {
document.createStyleSheet(src);
} else {
var css;
css = document.createElement('link');
css.rel = 'stylesheet';
css.type = 'text/css';
css.media = "all";
Preferences->Package Settings->SublimeLinter->Settings – User
{
"sublimelinter_executable_map":
{
"javascript":"C:/Program Files/nodejs/node.exe",
"css":"C:/Program Files/nodejs/node.exe",
This file contains hidden or 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
/** | |
* Check if a given ip is in a network | |
* @param string $ip IP to check in IPV4 format eg. 127.0.0.1 | |
* @param string $range IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed | |
* @return boolean true if the ip is in this range / false if not. | |
*/ | |
function ip_in_range( $ip, $range ) { | |
if ( strpos( $range, '/' ) == false ) { | |
$range .= '/32'; | |
} |
- Convert Putty private key to OpenSSH private key.
- Linux: with your package manager, install PuTTY (or the more minimal PuTTY-tools):
- Ubuntu
sudo apt-get install putty-tools
- Debian-like
apt-get install putty-tools
- Ubuntu
- Generate the private key:
puttygen id_dsa.ppk -O private-openssh -o id_dsa
- Generate the public key:
puttygen id_dsa.ppk -O public-openssh -o id_dsa.pub
- Copy
id_dsa
(600) andid_dsa.pub
(644) to~/.ssh
folder - In
~/.ssh/config
, add:
This file contains hidden or 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
sub load_class { | |
my($class, $prefix) = @_; | |
if ($prefix) { | |
unless ($class =~ s/^\+// || $class =~ /^$prefix/) { | |
$class = "$prefix\::$class"; | |
} | |
} | |
my $file = $class; |
Preferences > Key Bindings - User
[
{ "keys": ["ctrl+t", "ctrl+w"], "command": "toggle_setting", "args": {"setting": "word_wrap"}},
{ "keys": ["ctrl+alt+p"], "command": "prompt_select_workspace" }
]
> Preferences > Settings - User
- User(s) in a group:
getent group groupname
- To add user to a group:
sudo gpasswd -a username sudo
|sudo usermod -aG sudo username
- To add a new user:
sudo adduser new_username
- To remove/delete a user:
sudo userdel username
| Then remove user's folder if needed:sudo rm -r /home/username
orsudo deluser --remove-home username
- To remove user from a group:
gpasswd -d username group
- To modify the username:
usermod -l new_username old_username
- To change the password for a user:
sudo passwd username
- To change the shell for a user:
sudo chsh username
- To allow user to connect via SSH: add
username
to the lineAllowUsers
in/etc/ssh/sshd_config
- To grant user to root:
visudo
and addusername
(same withroot
)