Activity Stream

Activity Stream

  1. Cemmos added a article in Linux   

    Changing the Port Number of vsftpd
    By default, vsftpd (Very Secure FTP Daemon) utilizes port 21. To change this port is a fairly quick process.
    $ sudo nano /etc/vsftpd.confIn this file, find listen_port. If you can't find it, add it in yourself.
    listen_port=202Then restart vsftpd. $ sudo service vsftpd restart
    Make sure you allow this port to be used through your firewall. If you're using CSF, add the port to the TCP_IN and TCP_OUT connections.
    $ sudo nano /etc/csf/csf.conf# Allow incoming TCP ports TCP_IN = "20,21,25,53,80,110,143,443,465,587,993,995,202" # Allow outgoing TCP ports TCP_OUT = "20,21,25,53,80,110,113,443,202" $ sudo csf -r
    • 0 replies

  2. Cemmos added a article in Web Software   

    Getting Vanilla Forums to Work on Nginx
    # Rewrite to prettify Vanilla forum URLs location /forum { try_files $uri $uri/ @forum; } location @forum { rewrite ^/forum(.+)$ /forum/index.php?p=$1 last; }It's that simple. Add that to your server block in Nginx, and change "forum" to where your Vanilla Forum is installed.
    $ sudo service nginx reloadDon't forget to open up conf/config.php and add the following, if you didn't add the Nginx rules prior to installing the forum:
    $Configuration['Garden']['RewriteUrls'] = TRUE; 
    • 0 replies

  3. Cemmos added a article in CSS   

    Displaying an External Link Icon Using CSS
    Letting your visitors know that a link leads away from the site they're currently on can be a great practice to adopt. If you want to display a small icon at the end of every external link on your website, without having to add a class like "external" to your a hrefs, there's another option we can take.
    For all links, we can add the below. We'll get to removing the icon on the current site later.
    a[href^="https://"]:after, a[href^="http://"]:after {     font-family: FontAwesome; content: ""; margin-left: 4px; }Now, keep in mind that attribute selectors like this can be fairly heavy CSS, so it's not always advisable. But it can still beat other methods in terms of speed, so as long as your CSS is nice and clean overall, it really should pose zero problems.
    In content, I've added a FontAwesome icon. If you'd rather use an image, which will again be slower unless you add it to your existing sprites, remove the quotations and then add the link to your image within. Example:
    content: url(/images/externalicon.png);For more flexibility, you can use background image instead, as this icon can't be resized when using content in this manner.
    To remove the icon from internal links:
    a[href^=""]:after { content: ""; margin-left: 0; }Since the sites I run tend to use SSL exclusively, I've added only the https version. Make sure to change the site name to the site in question.
    • 0 replies

  4. Cemmos added a article in CKEditor   

    Creating a Custom CKEditor Button
    In CKEditor 4, the buttons on the toolbar are made up of various plugins, located in its /plugins/ folder. In our case, I needed to add a custom button that, when viewing the source, would look as such:
    <p class="h2">H2 Heading</p>It's a bit of a strange use-case, but it's for a website in which the software strips (sanitizes) headings, as it's built as community software and we don't want members adding headers. We then use JavaScript to convert this <p> tag into an actual <h2> tag where we want to allow it (an articles section that only team members can post to). In case you're curious, here's the jQuery:
    <script> /* Replace headings for semantic articles using jQuery */ $('p.h2').replaceWith(function() { return $('<h2>').addClass('heading').append($('<span>').html($(this).html())); }); $('p.h3').replaceWith(function() { return $('<h3>').addClass('h3').append($('<span>').html($(this).html())); }); </script>Most search engines will be able to see these headings as normal, so SEO-wise we're in the clear.
    Instead of always going into CKEditor's source tab and typing that HTML in manually every time, I figured it would be best to create a little plugin that added a heading button using the p tags with its class.
    CKEditor 4 Plugin
    Now we can get started. In CKEditor 4, the plugin's folder name needs to be the same as the plugin's name, otherwise it won't be recognized. We'll make a new folder in the /plugins/ directory called pheadings.
    The structure will look like this:
    /plugins/pheadings/plugins/pheadings/icons/plugins/pheadings/icons/pheadingh2.png/plugins/pheadings/plugin.jsLet's open up the plugin.js file and add:
    CKEDITOR.plugins.add( 'pheadings', {     icons: 'pheadingh2',     init: function( editor ) {         editor.addCommand( 'insertPHeadingH2', {             exec: function( editor ) {                 editor.insertHtml( '<p class="h2">Heading</p><p>&nbsp;</p>' );             }         });     } });And then we'll need to add this to the toolbar itself. This is added to the same init from above.
    editor.ui.addButton( 'PHeadingH2', { label: 'Insert Heading', command: 'insertPHeadingH2', toolbar: 'insert' });Finally, we can load the plugin. In the CKEDITOR.config.extraPlugins configuration, add the plugin name along with the other plugins you're running.
    config.extraPlugins = 'pluginA,pluginB,pheadings';
    • 0 replies

  5. Cemmos added a article in Linux   

    Switching from using a Socket to TCP/IP in PHP-FPM
    A couple of websites on our DigitalOcean VPS  have a great amount of traffic. Due to this traffic, I ran into the error below (edited for readability).
    [crit] connect() to unix:/var/run/php5-fpm.socket failed 2 No such file or directoryThis was because the amount of concurrent users was starting to get high. Instead of fiddling around too much, I thought it best to simply switch to a TCP/IP fast_param, as it's more scalable by default than using a socket.
    To do this, we need to edit a couple of files.
    $ sudo nano /etc/php5/fpm/pool.d/www.confIn this file, find the below line and uncomment it.
    ;listen = you have already have listen = unix:/var/run/php5-fpm.socket; in there, or another file in the pool.d folder, comment it out or replace it with the TCP/IP.
    Next, we'll need to edit the Virtual Host config files, which may be located in /etc/nginx/sites-available. Hopefully, you've used one global file for all of your PHP sites, otherwise you'll need to edit multiple files for each site. Look for:
    fastcgi_pass unix:/var/run/php5-fpm.sock;Comment it out or replace it with:
    Now we can get things reloaded.
    $ sudo service nginx reload $ sudo service php5-fpm reload 
    • 0 replies

  6. Cemmos added a article in Nginx   

    Fixing 504 Gateway Time Out (Nginx & PHP5-FPM)
    Since upgrading the server from Ubuntu 12.04 to 14.04 a couple of months ago, we ran into this problem: 'lfd on High 5 minute load average alert'.
    Because, during the upgrade, some files were replaced with newer versions such as PHP5-FPM's php.ini file, not all of our server configurations were exactly as they had been on the older version of Ubuntu. To quickly rectify the dreaded 504 Gateway Timeout, I needed to modify both the php.ini and www.conf files located in /etc/php5/fpm and /etc/php5/fpm/pool.d respectively.
    In php.ini, I upped the max_execution_time from 30 to 300.
    ;;;;;;;;;;;;;;;;;;; ; Resource Limits ; ;;;;;;;;;;;;;;;;;;; ; Maximum execution time of each script, in seconds ; ; Note: This directive is hardcoded to 0 for the CLI SAPI max_execution_time = 300In www.conf, the ;request_terminate_timeout needed to be uncommented (remove the semi-colon) and upped.
    request_terminate_timeout = 300And then restart the service.
    $ sudo service php5-fpm restart
    • 0 replies

  7. Cemmos added a article in Linux   

    "Excessive processes running under user"
    Sometimes you'll need to add certain packages to your Linux server, and CSF will sometimes send emails to make sure you can keep an eye on suspicious processes and activity. If you know something is not malicious, you can add it to the ignore file to stop receiving these emails. As an example, we recently installed NixStats to keep track of server usages and uptime. This adds a user called nixstats, which will be flagged when it's used, sending a lot of emails to you.
    Open up the file,
    $ sudo nano /etc/csf/csf.pignoreAt the bottom, along with what should be other lines, add using the following format:
    Then go ahead and restart lfd.
    $ sudo csf -rFor more details and information, check out ConfigServer.
    • 0 replies

  8. Cemmos added a article in JavaScript / jQuery   

    Don't use Javascript to add nofollow relationships
    rel="nofollow"Great for SEO if you use it correctly. But please don't use Javascript/jQuery to add this rel to your external links. It simply won't do anything, as most search engine bots don't parse JS on your site. Using PHPs preg_replace would actually allow bots to see this relationship on your links.
    Google actually does read the DOM, but not every search engine is made equally. But it also doesn't capture the nofollow specifically, because it's created too late in the DOM. Google will catch the link first.
    Using JS for similar purposes may work well, such as adding a class to your links, but definitely not for nofollowing. It will provide you with zero functionality with many search engines. I've seen it happen more than once, which is why I'm putting up this quick notice.
    Better yet, just add nofollow to your links manually or, if you're using something like CKEditor, set it so that external links automatically get the nofollow relationship.
    • 0 replies

  9. Cemmos added a article in CSS   

    Changing the viewport height when link-jumping
    When clicking on a #link that jumps to a particular part of a page, sometimes we need to take into account the viewport. If we have a fixed header, say 80px in height, our content will be overlapped by the header. To fix this, we can use some CSS magic:
    .jump_link:before { height: 80px; /* Same height as your header */ margin-top: -80px; /* Again */ content: " "; display: block; }Now every link with the class of jump_link will hit 80 pixels higher on the screen, allowing content to be visible. Modify per your needs.
    • 0 replies

  10. Cemmos added a article in CSS   

    Counting with CSS using CSS Counters
    body { counter-reset: count; } li a:before { counter-increment: count; content: counter(count) ". "; font-weight: bold; }I needed to use something like this to count the <LI>s within an unordered list <UL> for a table of contents generated using jQuery. It's simple, so there's not too much to explain about it. It's super handy though!
    • 0 replies

  11. Cemmos added a article in Oxwall   

    Use headings throughout your Oxwall installation using jQuery
    Using Oxwall with plugins such as the forum and third-party articles plugin, you may have noticed that you're not allowed to enter certain HTML. Well, you can, but it gets stripped once you've submitted the form. Instead of digging through core files that will be overwritten after upgrades and patches, we can use some jQuery magic.
    <script> $('p.h2').replaceWith(function() { return $('<h2>').addClass('heading').append($('<span>').text($(this).text())); }); </script>Add that to your Custom tail code section in the admin panel, or to html_document.html in your theme folder. Whichever you prefer. This code will replace the following,
    <p class="h2">This is an example header</p>With,
    <h2 class="h2"><span>This is an example header</span></h2>Now we can actually start writing some articles without worrying about our headings being stripped!
    • 0 replies

  12. Cemmos added a article in CSS   

    Optimal line-height for your CSS
    body { font: 100%/1.618 sans-serif; }While this won't exactly cover the golden ratio for line height when it comes to your content's width, this will at least help get you there with a starting CSS solution.
    • 0 replies

  13. Cemmos added a article in CSS   

    "Fixing" CSS of iOS buttons
    When you're designing a responsive theme, the buttons while browsing on an iOS device will take on their own consistent design. This tends to force your own buttons to take those elements as well. To be able to give your inputs and buttons your own CSS, simply add the following to them:
    -webkit-appearance: none; -webkit-border-radius: 0;  
    • 0 replies

  14. Cemmos added a article in General Web   

    Google Chrome "ERR_SPDY_PROTOCOL_ERROR" quick fix
    While using Chrome, you may have come across a ERR_SPDY_PROTOCOL_ERROR error. This has happened to me personally many times on websites such as Facebook and a couple that I develop myself. The issue is hard to reproduce and there are no error logs on the server to be had.
    What would happen is you'd navigate to the website and it would be inaccessible with the error above. But the site is still live and there are people still using it. So without having to close Chrome and reopen the web page, we can:
    Navigate to chrome://net-internals/#events&q=type:SPDY_SESSION%20is:active in ChromeClick on the small black arrow at the top-right hand corner and select "Flush sockets"Try the URL again in the same tab or window.
    Update: Here's a lengthier article I found using Google with other methods included:
    Over on Reddit, they recommend keeping a tab open, as this method is very temporary. I personally made the switch from Firefox to Chrome because it had become very sluggish even after re-installations, whereas Chrome seems speedy to this day. But at this point and with encountering these errors so often with Chrome, I think it's time to make the switch back to Firefox. Or hey, I could always use Opera or something.
    • 0 replies

  15. Cemmos added a article in Nginx   

    Using an Nginx rewrite to add trailing slashes to your URLs
    rewrite ^([^.]*[^/])$ $1/ permanent;Add to your server block. This line will add a trailing slash o the end of your URLs, as long as they don't contain a period (for things like static assets), and if it does not already have a trailing slash.
    This is a handy way to improve SEO by redirecting all non-trailing slash links to ones with the slash. Because yes, a single slash can cause duplicate content issues. Use this method along with adding canonical URLs throughout your site and you should be well on your way to better search engine optimization.
    • 0 replies

  16. Cemmos added a article in General Web   

    Styling an iframe with jQuery and CSS
    <script> $('iframe').load( function() { $('iframe').contents().find("head") .append($("<style type='text/css'> .yourCSS{background:#eee} </style>")); }); </script>That's pretty much it. Add the script where it needs to load. As an example, I used this to style the quoting feature within a textarea: 
    I believe there's only very hacky ways of doing this if the IFrame isn't coming from your own website. In those cases, it's best to find the source of the IFrame and edit it directly, if this option is available to you.
    • 0 replies

  17. Cemmos added a article in General Web   

    A Quick jQuery solution for a fixed website menu.
    With Beard Profile, we decided to make the website's header fixed. This should fix issues with long-scrolling article content, and most definitely the Newsfeed content. We initially had a Back to Top button, but a fixed menu seems to be a better option when it comes to keeping visitors navigating on your website.
    This is expected to be modified for your own header. It took me all of two minutes to set this up on the site which initially had a static header that stayed at the top.
    <script> $(function(){ $(window).scroll(function() { if ($(this).scrollTop() >= 40) { $('.site_panel').addClass('stickyPanel'); } else { $('.site_panel').removeClass('stickyPanel'); } }); }); </script>CSS:
    .site_panel { position: relative; top: 0; background: #fff url(images/repeat.png) scroll repeat 0 0; border-bottom: 1px solid rgba(0, 0, 0, 0.15); box-shadow: 0 0 8px -5px #000; } .stickyPanel { position: fixed; width: 1160px; max-width: 100%; z-index: 999; border-top: 0; top: 0; left: 50%; transform: translate(-50%, 0); } That's all the CSS I needed to get the menu fixed. This menu is also at a fixed width, so that's why you're seeing the left and transform in the stickyPanel selector. This keeps the menu centered on the screen. Simply remove those two lines and change 1160px to 100% if you're using a full-width menu.
    The number in this line of the JS should also be changed:
    if ($(this).scrollTop() >= 40)It's a px value as to when your sticky menu kicks in, depending on your website's layout.
    • 0 replies

  18. Cemmos added a article in Oxwall   

    Using Google Forms to pre-register members on your Oxwall-powered site
    Working with what's a new software for myself, Oxwall, I decided that it'd be a great idea to pre-register members before I even launched the site. This will help gauge interest, build a little bit of hype (I hope), and allows me to utilize these awesome people to kick start the community. Since, you know, a social network script like Oxwall is meant for community building. This is essentially like building an email list, I suppose. I don't know, I've never built one of those.
    A lot of this guide will assume you know how to do basic things like start your Google Form. It can also be done with any software that can import CSV files, but I'm specifically talking about Oxwall on this post.
    To begin, we'll go ahead and spin that form up. It'll be literally called "Google Form." Go ahead and start adding the fields you want. To make it easy, I decided to go with Username, Real Name, and Email Address. My screenshots will show the classic version of Google Forms because the new version is currently still a little buggy, at the time of this writing.

    There she blows. Pretty much all of the settings that my form has. Note that everything up top is unchecked. If you're not using Google Apps for Work, you might not see a couple of those options, which is fine. You can do all of this using a Gmail account.
    After the form's all set up and spiffy, go ahead and click on the Responses control up top and give your form a location to save its responses to. It will be a Google Spreadsheet that we'll eventually export as a CSV (comma separated values) file. The last step would be import this CSV using Oxwall's CSV Importer.
    Open up that spreadsheet that you linked to your form, hit on that Tools button real nice-like, and then "Script editor...". The below script will email both you and the form submitter that they've successfully signed up for your website. Copy and paste the entire thing over the example myFunction portion that's already in there. The email will be sent from your Gmail address, so you might want to register a new one if yours is something like Then again, that's a pretty awesome email address.
    /* Send Confirmation Email with Google Forms */ function Initialize() { var triggers = ScriptApp.getProjectTriggers(); for (var i in triggers) { ScriptApp.deleteTrigger(triggers[i]); } ScriptApp.newTrigger("SendConfirmationMail") .forSpreadsheet(SpreadsheetApp.getActiveSpreadsheet()) .onFormSubmit() .create(); } function SendConfirmationMail(e) { try { var ss, cc, sendername, subject, columns; var message, value, textbody, sender; // This is your email address and you will be in the CC cc = ""; // This will show up as the sender's name sendername = "Beard Profile"; // Optional but change the following variable // to have a custom subject for Google Docs emails subject = "Your Beard Profile pre-sign up was successful!"; // This is the body of the auto-reply message = "You've successfully sent your details. Your <strong>temporary</strong> password will be emailed to you when the site is opened in the coming weeks. <br>Thanks, and beard on!<br><br>"; ss = SpreadsheetApp.getActiveSheet(); columns = ss.getRange(1, 1, 1, ss.getLastColumn()).getValues()[0]; // This is the submitter's email address // Make sure you have a field called Email Address in the Google Form sender = e.namedValues["Email Address"].toString(); // Only include form values that are not blank for (var keys in columns) { var key = columns[keys]; var val = e.namedValues[key] ? e.namedValues[key].toString() : ""; if (val !== "") { message += key + ' :: ' + val + "<br />"; } } textbody = message.replace("<br>", "\n"); GmailApp.sendEmail(sender, subject, textbody, { cc: cc, name: sendername, htmlBody: message }); } catch (e) { Logger.log(e.toString()); } }I even left mine as-is so you can see exactly what you should edit:
    cc = ""; sendername = "Beard Profile"; subject = "Your Beard Profile pre-sign up was successful!"; message = "You've successfully sent your details. Your <strong>temporary</strong> password will be emailed to you when the site is opened in the coming weeks. <br>Thanks, and beard on!<br><br>"; Next, hit up your Oxwall installation and visit the maintenance page at /admin/pages/special-pages, make sure you enable maintenance mode, and then paste your Google Form iframe code in there. Boom!

    Don't forget you can customize your form template to better suit your own Oxwall theme, as seen in the example above. With a little CSS love on your .maintenance_cont class, and you're good to go.
    When it comes time to import your CSV, use the export function (Download as) on Google's Spreadsheet. Right click it once you've downloaded it, then .zip it up. Upload it to Oxwall's CSV importer, and select the correct profile field values to match your form's values. It's really that simple.
    Oh, and of course you don't even need to use your maintenance page like that, but I prefer doing so when the site is live on the web but still closed. I ended up choosing to share the sign up form directly through Google's form ( -- the maintenance page was just to catch any strays.
    • 0 replies

  19. Cemmos added a article in Linux   

    Using logrotate to rotate PHP5-FPM logs
    I recently noticed my php5-fpm.log file on my Ubuntu 12.04 server getting fairly large, so I needed to use logrotate to compress the log file and create a new one. In /etc/logrotate.d we'll have our individual application information, which overrides the defaults set in /etc/logrotate.conf . It's in logrotate.d where we'll create our php5-fpm log rotation file.
    cd /etc/logrotate.d sudo nano php5-fpmPaste the following,
    /var/log/php5-fpm.log { weekly missingok rotate 52 compress delaycompress notifempty create 0640 root adm sharedscripts postrotate invoke-rc.d php5-fpm restart > /dev/null endscript }This will rotate the log on a weekly basis. Save the file. If you're using SFTP rather than the command line, make sure you're saving your file in UNIX format, otherwise you'll get some errors when trying to rotate the log file. To test if it works, try sudo logrotate -d /etc/logrotate.d/php5-fpm. Read the output of that. If it looks good, you're set! If you'd like to force a log rotation now, use the following command.
    sudo logrotate --force /etc/logrotate.d/php5-fpm
    • 0 replies

  20. Cemmos added a article in Nginx   

    PHP5-FPM and Nginx white screen
    Ah, the infamous white screen of death. After doing some server and package upgrades, I ran across the problem of a blank screen being generated when trying to access the websites located on the server. None of the configuration files were changed, I had simply upgraded some packages and kept my settings intact. After checking Nginx's access logs, it showed an HTTP status of 200 OK, which is good. So with Nginx not being the problem, I decided to check out PHP-FPM. Everything seemed good on that end as well.
    After doing some digging and a bunch of Googling, I managed to find out I hadn't ever set the SCRIPT_FILENAME param in a conf file. It seems to be defined in the fastcgi.conf file, but the file that's being used is called fastcgi_params, which doesn't include this line. Add the below line to that file or to your location ~ \.php$ directive and you should be good to go.
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; And just for reference, this is what my location directive looks like:
    location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php5-fpm.socket; fastcgi_index index.php; include fastcgi_params; }
    • 0 replies

  21. Cemmos added a article in WordPress   

    Using Google's CDN to load jQuery, with a local fallback, on your WordPress-powered site
    Here's an easy way to enqueue jQuery using Google's Hosted Libraries with a local fallback. One of the great benefits of using a content delivery network to serve files is faster loading times for your visitors. In your theme's functions.php, go ahead and add this:
    // jQuery from Google's CDN, fallback to local if not available add_action('wp_enqueue_scripts', 'load_external_jQuery'); // Deregister jQuery that is included with WordPress function load_external_jQuery() { wp_deregister_script( 'jquery' ); // Check to make sure Google's library is available $link = ''; $try_url = @fopen($link,'r'); if( $try_url !== false ) { // If it's available, get it registered wp_register_script('jquery', '//'); } else { // Register the local file if CDN fails wp_register_script('jquery', get_template_directory_uri().'/library/js/libs/jquery.min.js', __FILE__, false, '1.11.1', true); } // Get it enqueued wp_enqueue_script('jquery'); }You'll likely need to change your the local path. I placed a minified version of jQuery 1.11.1 in my theme's Javascript library folder. You can change this to use the jQuery file included with WordPress, located in the wp-includes folder. At the time of this writing, WordPress uses jQuery 1.11.1, so be sure to change that to reflect the version you need.
    • 0 replies

  22. Cemmos added a article in Linux   

    DKIM on multiple domains with Exim4
    First off, we're going to assume that you've already set up Exim4 on your server and have already done the general configuration for it. It should be working and ready to go. We'll get DKIM set up so that we can have signed email from multiple domains — each signed by their respective TLDs.  
    Getting DKIM set up
    Let's get our keys generated.
    # Make your DKIM directory $ mkdir /etc/exim4/dkim # Head on inside that directory $ cd /etc/exim4/dkim # Generate the private key. Change to one of your domain names. # Repeat this step for each domain name $ openssl genrsa -out 1024 # Generate the public key by extracting from the private key. # Repeat this step for each domain name $ openssl rsa -in -pubout > # Set the permissions $ chown -R Debian-exim:Debian-exim /etc/exim4/dkim/ $ chmod 640 /etc/exim4/dkim/*Remember to repeat the process of generating private/public keys for each of your domain names. Now open up /etc/exim4/exim4.conf.template . This is if you're not using the split configuration in Exim4. You chose this during the initial set up. If you are using split config, open up this file instead: /etc/exim4/conf.d/transport/30_exim4-config_remote_smtp . Find the line below:
    ##################################################### ### end transport/30_exim4-config_remote_smtp #####################################################Above that, add:
    DKIM_DOMAIN = ${lc:${domain:$h_from:}} DKIM_FILE = /etc/exim4/dkim/${lc:${domain:$h_from:}}.pem DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}} DKIM_SELECTOR = mail DKIM_CANON = relaxedNow let's restart Exim4. /etc/init.d/exim4 restart  
    Adding the TXT DNS record
    The last step we need to do is edit our DNS and add a TXT record. Normally, we'll have two fields: a name field, and a text/value field. In the name field, you'll add mail._domainkey . Note mail._ there. That's the value we added to DKIM_SELECTOR, so if you changed that value, change mail._ to reflect that. Name: mail._domainkey Text:
    "v=DKIM1; p=MIGfMA0CGSqGSIb3DQEBAQUAA4GNADCBiQKBgQDecXeuzMCtnWstzeQ3Rtib3Qm47BAtzDuNai+ybuDin7sGzCpa9ukrtWTzRejWwfPWO6UgCaCrM1NqCnt2xt0v6RrhUm1ufHCtpuFAYJ9ubdcxdyo/Xwv2tAa5K748YzuIAI3fio8RFQ3flKJowCsg9wDjCSvjUm3NMPfebeR9PwIDAQAB"The text field above is our public key, while Exim4 has the location of our private key defined in its config file. You can open the .pub file with any editor of your choice, whether through the command line or something like FileZilla. The entire file will look something like this:
    -----BEGIN PUBLIC KEY----- MIGfMA0CGSqGSIb3DQEBAQUAA4GNADCBiQKBgQDecXeuzMCtnWstzeQ3Rtib3Qm4 7BAtzDuNai+ybuDin7sGzCpa9ukrtWTzRejWwfPWO6UgCaCrM1NqCnt2xt0v6Rrh Um1ufHCtpuFAYJ9ubdcxdyo/Xwv2tAa5K748YzuIAI3fio8RFQ3flKJowCsg9wDj CSvjUm3NMPfebeR9PwIDAQAB -----END PUBLIC KEY-----Carefully remove the line breaks when adding this to your TXT record. It needs to be in a single line. Use this same name selector for all of your domains, but repeat the public key portion for each domain name, as they need to match their private key counterparts.  
    SPF record
    If you don't already have an SPF record, do that as well: Name: @ Text: "v=spf1 ip4:yourserverIPaddress ~all" Change yourserverIPaddress to your server's actual IP address.  
    Test your SPF + DKIM
    I ran across this site during a Google search, which is a great tool to see if you've got things set up right: Simple enter your domain name and DKIM selector, then check the results below. If everything looks okay, we can move onto actually testing the email headers that are sent. If you have a Gmail or Yahoo! email account, you can see if your emails are being signed correctly by sending an email to yourself. Using the command line,
    echo "This is a test." | mail -s Testing
    Alternatively, send an email to and you'll receive a report back instantly.
    • 0 replies

  23. Cemmos added a article in Nginx   

    XenForo in a subdirectory with Nginx
    For one of my recent projects, I needed to use WordPress and XenForo -- with WordPress sitting at the root and XenForo in a subdirectory called community. Here's the config file that I used to successfully install XenForo in a subdirectory. It's really simple.
    ## ## # Subdirectory for XenForo # ## ## location /community { try_files $uri $uri/ /community/index.php?$uri&$args; index index.php index.html; } location /community/(internal_data|library)/(.*)$ { internal; }All you need to do is get that pasted into the Server block of your WordPress Nginx config and you'll be good to go! Note that I left off the trailing slash in the location directive. That will allow you to access the subdirectory whether it's linked as or
    • 0 replies

  24. Cemmos added a article in General Web   

    Setting up Office 365 using DigitalOcean's DNS management
    If you're not familiar with how to set up certain things in regards to DNS, you might get a little stumped using Microsoft's instructions. They do provide specific how-to's with a lot of popular DNS hosting providers, but there's no way to add one-size-fits-all instructions (well, there is, but only if you know what you're doing). For those on DigitalOcean, here's how you can set up your DNS records to get your email services working.  
    Confirm your domain name using a TXT record
    First off, go ahead and follow through with step 1, which is used to confirm that you own the domain name you're setting up. I chose to use the TXT record, which was a matter of going into DigitalOcean's DNS manager, clicking the domain name we wanted to edit, and then clicking "Add Record" at the top-right of the screen. This will give you a drop-down of the available options. Select TXT and inside of the Enter Name field, type Take note of the trailing dot at the end there. Then, in the Enter Text field, paste the value they want you to add. It looks something like ms=4382944, if I recall correctly. Don't use that one, as I just made up those numbers. Wait anywhere from 15 minutes to 2 hours for this to process. We can't edit TTL (time to live) at the time of this writing, on DigitalOcean, so expect to wait about an hour, as the default TTL is set to 1800. Go through steps 2 and 3, following the instructions given.  
    Step four of four
    Now we're at the good part. All of the DNS records. Most of these will be easy, so I'll give a general outline of what you need to enter for each record.
    CNAME records
    When told to enter a CNAME record, use the values they give you. So if they say to add , enter that into the name field, but don't forget the trailing period. So it'll be . For the hostname, paste the value they give, and again, add the trailing period.
    TXT records
    When told to enter TXT records, you'll use in the name field, or @ if you have an A record pointing to your droplet's IP address. Either will work. For the value (Enter Text) field:
    "v=spf1 -all"— use that exactly, with the quotes. When entering TXT values with white space, you'll want to wrap it with quotes, otherwise the text could be read as one string (without the spaces). Which would be wrong. Take note that this can be your only SPF record and it must look exactly like this. Office 365 won't detect it at all if you've modified the value, so be sure to use this and double check that what I'm showing here hasn't changed and is current. You can change this SPF record after it has been verified during the initial set up. So if you want to include your droplet and other sources, edit the record later.
    SRV records
    Here's the hardest part to do. You'll be given a bunch of values and a protocol to use, but there won't be specific fields as to where to add these. So make sure the formatting is as such,
    Priority: 100
    Port: 443
    Weight: 1
    And the next one,
    Priority: 100
    Port: 5061
    Weight: 1
    Good job, you're all done!
    Keep hitting that retry button or go off and get yourself a "job well-done" snack. Once your DNS has been refreshed and detected by Microsoft, you'll be good to go. Now you can move on to more important things. If you've ran into any trouble or if I wasn't clear enough on what to do, feel free to leave a comment with your issue and we'll work through it. Together. *Tear*
    • 0 replies

  25. Cemmos added a article in Linux   

    PuTTY on the go with PuTTY Portable
    As I have a trip coming up within 24 hours to the Netherlands, I thought it would be a good idea to take PuTTY along with me. I only ever use my laptop when I'm traveling, but I've rarely ever used it for work since that's generally reserved for my desktop. But seeing as how I'm always working these days, I thought "why not, let's do this." So I Googled and found a pretty cool portable app over at You can grab PuTTY Portable and place it onto a USB drive or CD so that you don't have to install PuTTY on every system you use.
    It's extremely handy and works exactly the same as its non-portable version. What's even better is how easy it is to load your current configs and use them in your portable version. It's not a feature of the app, but it can be done in just a couple of minutes.
    So what you'll need to do is grab a backup of PuTTY's registry on your current system. Here's the process on Windows:
    Click on the start button and type in "regedit" without the quotes. Open that up, it's your registry editor.On the left-hand side, open HKEY_CURRENT_USER, click on Software, and then SimonTatham.On the right you'll see (Default) with a type of REG_SZ. Select default, then click on File -> Export. Save it as putty.regGo back to where you placed PuTTY Portable, and then toss putty.reg into the Data folder.Now you should have your system's PuTTY settings ready to go. If you use SSH Keys to authenticate your sessions, don't forget to bring those along too. You'll need to change the directory in the Auth settings, but hey, that's not so bad. It sure beats having to manually insert all of your sessions. If you use a service like Dropbox to store your keys, you should be good right away.
    • 0 replies