Be cautious when you copy-paste into terminal

A great article on why you should be careful when copying and pasting commands into a terminal/command-line.

http://thejh.net/misc/website-terminal-copy-paste

I ensure the material on this site is safe from malicious practices like that, but it’s a good thing to keep an eye when pasting content into your terminal.

Advertisements
Aside

Edit GitHub Pages

Here’s a quick guide to editing GitHub Pages. Not familiar with GitHub Pages? It’s a totally free service provided by GitHub where you can freely host HTML pages. Read more about it here: https://pages.github.com/

The Details

GitHub uses a separate branch for those pages so you can access the gh-pages branch like so:

In your GitHub repo, click to open the Branches drop-down.

GitHub branch dropdown

Select gh-pages.

GitHub gh-pages branch

You’ll be switched over to the gh-pages branch, where you should see the files served publicly such as the index.html file.

GitHub gh-pages index.html

Click on the index.html file to open it, then click Edit (pencil) icon to make changes.

GitHub gh-pages edit index.html

Once you’re done with editing, scroll to the bottom of the page and you’ll see a Commit changes button. To save the changes, press that button and optionally leave a comment about the changes.

GitHub gh-pages edit commit

That’s it!

You should see the change(s) reflected when viewing the page in your browser, through the page’s github.io url (or via a custom domain if you’ve set configured that).

The command-line method

Of course, if you’re more comfortable editing through your command-line or linux terminal, it’s very simple. If you haven’t already, clone your repo locally. For example, you can clone my Nibble project like so:

git clone https://github.com/Ugotsta/nibble.git

Once that’s cloned, go to the project folder:

cd nibble

Then access the gh-pages branch using the git-checkout command like so:

git checkout gh-pages

You’ll then be able to see and edit the files from the gh-pages branch. You can make your changes to the index.html file, like so (using Vim) for example:

vim index.html

You can make the changes to the file, then add those files as part of a commit using git add:

git add .

Commit those changes with git-commit:

git commit

The commit process will request a comment, to be added to the changelog. On linux systems, usually Nano is used for the comments.

When using Nano:

  1. Type any comments you’d like to add.
  2. Press CTRL-O to save.
  3. To select and overwrite the file you’re viewing, press ENTER.
  4. Then CTRL-X to return to your terminal prompt.

Now you can push those changes back to the repository with git-push:

git push

that’s it for the command-line!

Here’s a quick syntax-colored summary of those commands:

git clone https://github.com/Ugotsta/nibble.git
cd nibble
git checkout gh-pages
vim index.html
git add .
git commit
git push

I hope that helps, feel free to ask if anything’s unclear. 🙂

Edit GitHub Pages

Fun-themed music visualization with P5.js

I posted about this eerie-themed music visualizer I created using P5.js a fair moment back, and as I noted there, I planned to create more visualizers. Here’s the next in that series, a fun, orange-blue theme to fit my re-launched site at daskitz.ugotsta.com.

Check out the visualizer here: ugotsta.github.io/projects/p5-daskitz.html?url=https://soundcloud.com/ugotsta/grampa-howie

As with my previous one, you can change the ?url= parameter to any SoundCloud track and it’ll play it.

And here’s an example from my recent post for DasKitz:

Still more to come

I do still have plans for more. However, I’m also working on a way to encapsulate the code to make it more extensible. Meanwhile, feel free to alter the code yourself.

Code here: https://github.com/Ugotsta/Ugotsta.github.io/blob/master/projects/p5-daskitz.html

Cheers!

Fun-themed music visualization with P5.js

MilkDrop visualization database

To this day, Winamp still has some of the most jaw-dropping music visualizations via the MilkDrop plugin. MilkDrop has now been ported to other software and systems but it’s bundled right into Winamp.

I used MilkDrop for some recent projects, I have more projects using it on the way too. But I couldn’t seem to find anything cataloging the massive list of presets.

So I’ve begun one, using YouTube for the videos. Here’s the current playlist:

One Problem

There are well past 1000 great presets for MilkDrop and I couldn’t feasibly create videos for them all manually. Moreover, it was admittedly kinda tough finding a way to record them in the first place.

Solution

So, I used AutoIt to automate the process. Here’s the script I setup for the recording process using MSI Afterburner:

https://gist.github.com/Ugotsta/57b385a44039460159c7

And here’s the script I used to seamlessly loop the videos using MLT.

https://gist.github.com/Ugotsta/3496a2706e71dd46e538

I don’t have the time to go through the details right now. But I’ll gladly follow up with some details should anyone ask.

For now, here’s a link to the site I’ll be using to house the database: http://visualize.ugotsta.com/

It’s just a blog at blogger.com, it’s also kinda hideous right now. But it’s the easiest way to setup a database like this.

Cheers! 🙂

MilkDrop visualization database

YouTube with no sound + autoplay = gif!

I mean this very lightly, but using a YouTube video that has no sound, along with the auto-play feature, can sometimes pass instead of using a GIF file.

For example, one site using auto-play with no sound: https://gdevapp.com/

Given the length of the video there, GIF might not be feasible. That YouTube clip provides a better option. It could also potentially draw people in to the YouTube channel for similar videos.

There are lots of cases where GIF will be better, but there are cases like the above where an auto-played YouTube video is optimal.

Aside

Deactivate WordPress plugins and themes from phpMyAdmin

Sometimes plugin or theme conflicts can disable a WordPress site. Often, renaming the plugin folder can get your site back up, but if you don’t have access to the file system, it’s kinda tough to rename that folder! If you have access to the database though, you can try using phpMyAdmin to disable the plugins and/or theme.

Here’s a walk-through for that.

The Details

You’ll need to ensure you’re logged in to phpMyAdmin. If you’re not sure how to access that, you can ask your web host. They’ll usually provide a help page for it.

Once logged in to phpMyAdmin, you can switch the current theme as follows.

Select your main WordPress table.

phpMyAdmin - Select WP table

Select the wp_options table (the name might be different depending on how you or your web host has configured it but wp_options is the most common and default name).

phpMyAdmin - Select wp_options table

Click the Search tab.

phpMyAdmin - Search tab

Replace ‘template’ option

In the options name field, type ‘template‘ and press Enter (or press the Go button).

phpMyAdmin - Search for 'template'

You’ll then see a list of results, there should be just one item there with the option_name ‘template’. Locate the ‘option_value‘ column and double-click that value.

phpMyAdmin - Search results - Edit option_value

Replace that value with ‘twentyfifteen‘ and press Enter.phpMyAdmin - Search and replace template value

That will set the theme to Twenty Fifteen, which is the best current starting point for trouble shooting.

REPLACE ‘stylesheet’ OPTION

Now, do that once more for the stylesheet. Click the Search tab and in the option_name field, type ‘stylesheet‘ and press Enter.

In the search results, change the option_value to ‘twentyfifteen‘.

REPLACE ‘active_plugins’ OPTION

We’ll do that just one more time, for the active plugins. Click the Search tab again and in the option_name field, type ‘active_plugins‘ and press Enter.

The option_value for that one should look rather cryptic. Simply select and delete it all and press Enter.

phpMyAdmin - Search and replace 'active_plugins'

That will deactivate all the plugins on your site.

 

 

That’s it!

With that done, assuming the trouble on your site was due to a plugin or theme conflict of some sort, you should be able to access your site once more.

To help with the troubleshooting, here’s a very helpful flowchart: http://premium.wpmudev.org/wp-content/uploads/2013/12/Support-Process-Support-Process.png

Which reminds me, if it’s still presenting trouble, or if you’d just rather not bother with it yourself, I’d recommend checking with these guys: https://premium.wpmudev.org/

WPMU DEV provides extensive, professional support services for the WordPress platform, backed by many years of experience (they’re the same people behind Edublogs.org).

Cheers! 🙂

Deactivate WordPress plugins and themes from phpMyAdmin