Facebook – Saving a (live) video or a regular movie

How to save a live stream video or a regular movie from Facebook (in .mp4 format)?

Follow these easy steps:

  1. find the live stream video (or regular Facebook movie) on a timeline, page or profile
  2. play the movie
  3. right-click on it and copy the URL of the video (“Show video URL“)
  4. paste the URL into a new browser tab / window
  5. IMPORTANT: in the URL, change the https://www. to https://m. (turning the movie into a mobile version of the movie)
  6. play the movie and right-click on it
  7. save the movie as a .mp4 movie (“Save Video As“)

Et voila!


Windows – Enabling / Disabling SMB 1.0

How to enable / disable SMB 1.0 on Windows 7?

To prevent ransomware, it’s best to disable SMBv1 (‘WannaCry’ uses a SMBv1 exploit, for instance).
However, if you use older network drives (in my case WD MyBookWorld), they might become unreachable without SMBv1 (which happened to me…)

This applies to: Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8, and Windows Server 2012

Note: When you enable or disable SMBv2 in Windows 8 or in Windows Server 2012, SMBv3 is also enabled or disabled. This behavior occurs because these protocols share the same stack.

To disable SMBv1 on the SMB client, run the following commands (in the elevated command prompt):

 sc.exe config lanmanworkstation depend=bowser/mrxsmb20/nsi
 sc.exe config mrxsmb10 start=disabled

To enable SMBv1 on the SMB client, run the following commands:

sc.exe config lanmanworkstation depend=bowser/mrxsmb10/mrxsmb20/nsi
sc.exe config mrxsmb10 start=auto

Resource:
https://support.microsoft.com/en-gb/help/2696547/how-to-enable-and-disable-smbv1-smbv2-and-smbv3-in-windows-and-windows-server


Hosting – Point a domain at an IP-address

How to point a domain at an IP-address?
In this example: point the ‘myexample.com’ domain  to the IP-address 12.34.56.789.

REGISTRAR

Go to the CPanel of your registrar, and add two A-Records:

Type Host Value
A Record @ 12.34.56.789
A Record www 12.34.56.789

HOSTING (PROVIDER)

Log in on your hosting provider (using a SSH connection, with, for instance, Putty).

Go to the Apache2 available sites directory:

cd /etc/apache2/sites-available/

Create a file called myexample.com.conf (fill in the name of your site, of course) with the following content:

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin (email address of the webmaster)
        ServerName myexample.com
        ServerAlias www.myexample.com
        DocumentRoot /var/www/myexample.com/public_html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

Go to the Apache2 enabled sites directory:

cd /etc/apache2/sites-enabled/

Create a symlink to the file you just created:

ln -s /etc/apache2/sites-available/myexample.com.conf

Start the new virtual host:

sudo a2ensite myexample.com.conf

Restart the web server:

sudo service apache2 restart

Et, voila!

Resource:
https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts

 



WordPress – How to override javascript files in a child theme?

How to override javascript files in a child theme?

Add to your functions.php  file the following code:

<?php
 // hook in late to make sure the parent theme's registration
 // has fired so you can undo it. Otherwise the parent will simply
 // enqueue its script anyway.
 add_action('wp_enqueue_scripts', 'wpse26822_script_fix', 100);
 function wpse26822_script_fix()
 {   wp_dequeue_script('parent_theme_script_handle');
     wp_enqueue_script('child_theme_script_handle',
        get_stylesheet_directory_uri().'/scripts/yourjs.js', array('jquery'));
 }
 ?>

Resource:
http://wordpress.stackexchange.com/questions/26822/how-to-override-javascript-files-in-child-theme




Processing – Disable console messages

How to suppress all console messages in a Processing sketch?

Add the following code to your sketch:

// FOR SUPPRESSING CONSOLE MESSAGES
import java.io.PrintStream;
import java.io.OutputStream;

void setup() {
 // Suppress Error Messages (the RED messages)
 System.setErr(new PrintStream(new OutputStream() {
 public void write(int b) {
 }
 }));
 // Suppress Warnings and Regular Messages (the GRAY messages)
 System.setOut(new PrintStream(new OutputStream() {
 public void write(int b) {
 }
 }));
 [... the rest of your code ...]
 } // setup()

Resource:
http://stackoverflow.com/questions/16722462/processing-hide-console-warning

Tested up to: Processing v3.3.3


WordPress – Briefly unavailable for scheduled maintenance

When you get an empty page with an error message saying:

"Briefly unavailable for scheduled maintenance. Check back in a minute."

Go to the root of your website and delete a file called .maintenance.

Note: it’s a HIDDEN file, so make sure your FTP client shows hidden files too!