Table 'performance_schema.session_variables' doesn't exist.

I encountered this error in Mysql version 5.7.13 after upgrading Laragon when attempting to connect with HeidiSQL.

Here's how to fix it (from the command line):
mysql -u {user} -p
mysql> set @@global.show_compatibility_56=ON;


Replace {user} with your actual username (probably root). When it prompts for password.. enter your password.

This is a temporary fix that would need to be run once on server start.

If it fixes your issue, add this to your my.ini:

[mysqld]
show_compatibility_56 = 1


You should already have options under [mysqld] .. append this new one to that section or modify existing entry accordingly.

Output Laravel 4 view as string

The answer seems really obvious once you know it.

[php]
->render();
[/php]

Used like this:

[php]
$nav_primary_data = json_decode(file_get_contents('navs/primary.json', true);
$view_string = View::make('layouts.master.navs.primary')->with('nav_primary_data', $data)->render();
[/php]

I'm not sure why it's not mentioned in the Views & Responses documentation.

But the method can be seen in the API docs: \Illuminate\View\View

Great use of comments

(in .htaccess)

[plain]
#Error Documents
ErrorDocument 404 /errors/404.php
ErrorDocument 403 /errors/403.html
[/plain]

If that comment wasn't left there, I would've been totally clueless that the following rules had to do with error documents. Thanks, guy!

Do you have an example of a really helpful note someone left for you in code? Share it with us in the comments!

How to set up SSH key authentication in CentOS 6.4

1. Generate your keys

[sourcecode language="plain"]
ssh-keygen -t rsa -C "[email protected]"
[/sourcecode]

2. Copy public key to authorized_keys


[sourcecode language="plain"]
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[/sourcecode]

3. Chmod

[sourcecode language="plain"]
chmod 700 ~/ssh
chmod 600 ~/ssh/id_rsa.pub
chmod 600 ~/ssh/authorized_keys
[/sourcecode]

4. Enable key authentication in sshd_config

[sourcecode language="plain" title="Open sshd_config for editing"]nano /etc/ssh/sshd_config[/sourcecode]

[sourcecode language="plain" title="uncomment (remove the #) these lines in /etc/ssh/ssdh_config and write the changes"]
#RSAAuthentication yes
#PubkeyAuthentication yes
[/sourcecode]

[sourcecode language="plain" title="restart the sshd service"]service sshd restart[/sourcecode]

[sourcecode language="plain" title="put your private key in your other environment and test it"]ssh [email protected] -i ~/.ssh/id_rsa[/sourcecode]

Switched to a Git workflow for this site

I'm sure there are others interested in doing this, so here's how I did it:

* Must have SSH access on your website's host server *

** Must have Git installed on Remote and Local **

I'm not going into details about how to do the above. There are some helpful links at the bottom.

I'm going to reference my own set up configuration.. use your brain to fill in the correct info for your own site.

If you have questions, send me an email, tweet me, google+ or whatever.

How I set up my Git workflow

 

Part 1: Site Hub (bare repository)

SSH into joejiko.com's root ~/

Make a folder in the root directory to house the bare repository. (eg. ~/site.git)

Initialize a bare git repository:

git init  --bare

Create a post-receive hook to push the working directory to the site's public folder

The post-receive hook goes into the bare repository's hooks folder (eg. ~/site.git/hooks/post-receive

Its contents look like this:

post-receive
#!/bin/sh 
GIT_WORK_TREE=/home/USER/public_html/ git checkout -f

Make sure the directory exists!

Chmod +x your post-receive file

In your SSH client, navigate to your hooks directory and use
chmod +x post-receive

 

Part 2: Local Repo

Set a folder to hold your site files and initialize your Git repository
git init

Add the site files and commit
git add .
git commit -m "initial commit"

Add the remote server and push
git remote add web ssh://site.com/home/USER/site.git
git push web +master:refs/heads/master

 

That's it!

If you need more instruction, you can try "Using Git to manage a web site" which basically goes through the same process (only in much more words)

I'll update this as I continue to use this workflow and become more familiar with Git

 

If you have anything to add or see a mistake, please let me know!

 

Some additional notes/things to google:

* SSH keys. SSH is much easier if you use keys (so you can push with a special password instead of your username and the password on your hosting account that's probably super annoyingly "secure")

Related reading:

Google+ sign in helpful tips

While implementing the G+ sign in on my site, there were a few "need to know" things that were buried in the documentation.

Hopefully this helps someone.

I'm using the HTTP API.

The "old" system uses the scopes:
https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email

whereas the new one uses:
https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/plus.me<

Update: Actually you still need to use
https://www.googleapis.com/auth/userinfo.email

auth/plus.me does return a bunch of useful profile information, though.

You'll see the auth/plus.login fairly quickly while reading the API docs, but mention of the auth/plus.me is a little buried.

In the docs the person GET request looks like
GET https://www.googleapis.com/plus/v1/people/userId

 

If you're just using auth/plus.login scope, you'll have to request the userid and then make a separate API call to get the person's info. (

OR you use auth/plus.me scope and set "me" as the userid in the GET request.

 

I'll update this as I experiment with the API some more.

 

If you'd like to add anything, leave a comment.

 

related links:

https://developers.google.com/+/api/latest/people/get#examples
http://googleplusplatform.blogspot.com/2013/02/google-plus-sign-in.html

How to upgrade to the latest version of Feng Office (the easy version)

*Download the latest version --> click here (current version is 2.2.3.1 or something)

*Delete everything except for these folders: cache, config, tmp, upload

and these files: php.ini, .htaccess

(Or delete them. Doesn't really matter.)

*Upload the new files

*Go to /public/upgrade

OK. Done.

upgrade-feng-office

TL;DR

*Make sure you back up everything (I'm not going to tell you how to do that. Google is your friend)

* the upgrade url: /public/upgrade is relative to your FO installation directory. So if you put your files in joejiko.com/feng, your upgrade URL would be joejiko.com/feng/public/upgrade

 

Any questions?

 

Here's the link to the official migration documentation, AKA clusterfuck of ugly and irrelevant.

http://www.fengoffice.com/web/wiki/doku.php/installation:migration

fo-upgrade-page

34,000 tracks played since 2009! See them here



I made an app awhile back to pull my Last.fm scrobbled tracks into a feed (actually it can pull data from any last.fm user). You can browse all 3403 pages dating back over 4 years!

In additional to integrating with Last.fm's scrobbling API, I included a "play on Spotify" icon that will perform a search through Spotify's API and play the song instantly to Spotify (if it's installed on the user's machine.

Setting up the photo gallery today!

Working with WideImage today to create an image/media management system inside of my application's framework.

Do any of you have suggestions for the best way to organize a database schema to reference images in a file system?

My current approach is to run sha1_filename on the image to generate a filename, then store the image to the FS in an image folder path above the root.

I'm creating two sub folders to house the images based on the sha1_filename, for example:

83d8281665383fa968f34a91e7539b947d3a59d1.jpg is stored as
IMAGES_ROOT/83/d8/83d8281665383fa968f34a91e7539b947d3a59d1.jpg

My current reference table SQL looks something like this:

CREATE  TABLE IF NOT EXISTS `images` (
`id` INT(20) NOT NULL COMMENT 'image id' ,
`filename` VARCHAR(255) NOT NULL COMMENT 'relative path to file on FS' ,
`size` INT(8) NULL COMMENT 'file size' ,
`width` INT(5) NULL ,
`height` INT(5) NULL ,
`metadata` TEXT NULL COMMENT 'image meta' ,
`mime_type` VARCHAR(45) NOT NULL COMMENT 'mime type\n' ,
`caption` TEXT NULL COMMENT 'image caption' ,
`uploaded_by` INT(5) NULL ,
`created` DATETIME NOT NULL ,
`modified` DATETIME NULL ,
`live` TINYINT(1) NULL DEFAULT 1 COMMENT 'publicly visible?' ,
`deleted` TINYINT(1) NULL DEFAULT 0 COMMENT 'shown in listings' ,
PRIMARY KEY (`id`) )
ENGINE = InnoDB

Eventually I'm going to add tags and categories, but that can also be done later.

Thoughts?

 

Update 2/26
I ended up using PHP Image Workshop instead.

Why? It's got a better website and um.. the code is newer.

Right now the photo gallery isn't finished, but it's up if you're interested.



 

I've uploaded over 500 photos. Enjoy!

Wordpress plugin Twitconnect crashed my blog!

twitconnectWent to my blog to show a coworker my Iron Man christmas comic.. only to be met with a 500 server error.

I inspected the error_log and found the culprit to be the Twitconnect plugin not being able to redeclare one of its classes.

 

I didn't change anything, so I'm not sure why it suddenly decided to have an issue.

I deleted the Twitconnect directory from /wp-content/plugins and that fixed it.

Youtube: Load denied by X-Frame-Options

Load denied by X-Frame-Options: http://www.youtube.com/embed/wtI6TL516pU does not permit cross-origin framing.

x-frame-optionsWHAT!?

When loading an iframe with $.prop('src', src)

Keep calm and switch to Youtube API.

But, it's annoying.

Also, Chrome doesn't give me this error.

Update: Actually Chrome is now giving me this error too.

Did Youtube change something?

Update 2: Tried HTTPS (still didn't work)

Went to Youtube Developer site to try alternative methods (always nice to have a backup) & guess what I found!

Lol they're having issues too.

Yeah, the Youtube Player Demo is having an error.

Not a good sign..

Update 3: Back up!

Other humans who shared in this experience (and wrote about it)

http://jakebot.com/2013/youtube-breaks-embeds-everywhere

http://seanmccambridge.com/2013/02/06/youtube-iframe-embeds-down/

http://retrohelix.com/2013/02/is-youtubes-iframe-broken/

Love you Internets! 8-]

Did you find what you're looking for? Tell me about it in the comments!