Ctrl + K is used to Cut a line.
Alt + ^ is used to Copy it.
Ctrl + U is used to paste them.
Ctrl + K is used to Cut a line.
Alt + ^ is used to Copy it.
Ctrl + U is used to paste them.
| #cloud-config | |
| apt_sources: | |
| # Enable MongoDB repository | |
| - source: deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse | |
| keyid: 7F0CEB10 | |
| filename: mongodb.list | |
| apt_update: true | |
| packages: | |
| - mongodb-org |
| <?php | |
| $name = pathinfo($file, PATHINFO_FILENAME); // returns filename | |
| $ext = pathinfo($file, PATHINFO_EXTENSION); // returns extension |
| $str = "I 'am' a <strong>monster</strong>!"; | |
| // This will preserve the HTML tags (as well as the quotes) and make it safe to save into MySQL. | |
| echo htmlentities($str, ENT_QUOTES); | |
| // To display it with all its HTML glory, use html_entity_decode(). | |
| echo html_entity_decode($str); |
| /** | |
| * Check if the current array element is the last one, if it is, do something. | |
| */ | |
| $array = array('a' => 1,'b' => 2,'c' => 3); | |
| $lastElement = end($array); | |
| foreach($array as $k => $v) { | |
| echo $v . '<br/>'; | |
| if($v == $lastElement) { | |
| // This is the last element. Do as you please. |
From the terminal, fire this up:
wget -r ftp://user:[email protected]/<path to your directory>
If you've some special characters in the credentials, you can specify the --user and --password arguments to get it to work.
Example with custom login with specific characters:
wget -r --user="user@login" --password="Pa$$wo|^D" ftp://server.com/<path to your directory>
cd ~/.ssh
ssh-keygen -t rsa
enter gitlab_rsa leave password empty
cat ~/.ssh/gitlab_rsa.pub
| <?php | |
| function scan_dir($dir) { | |
| $ignored = array('.', '..', '.svn', '.htaccess'); | |
| $files = array(); | |
| foreach (scandir($dir) as $file) { | |
| if (in_array($file, $ignored)) continue; | |
| $files[$file] = filemtime($dir . '/' . $file); | |
| } |
Run:
sudo apt-get install vsftpd
Edit /etc/vsftpd.conf
Disable anonymous login
anonymous_enable = NO
| #Mounting the share is a 2 stage process: | |
| # 1. Create a directory that will be the mount point | |
| # 2. Mount the share to that directory | |
| #Create the mount point: | |
| mkdir share_name | |
| #Mount the share (edited for Mac OS X): | |
| #The -t flag is to indicate the file system type. In this case, it is smbfs. | |
| mount -t smbfs //username:[email protected]/share_name share_name/ |