RSS
 

Archive for the ‘Tech’ Category

Syndicating your Google Plus Feed into your WordPress Blog

18 Aug

 

Somebody mentioned that it was hard/impossible to do this, and i know that a few people will want to. So i figured i would hunt about and see if it was possible, and it is! It’s not even too difficult!

First of all, go to http://plusfeed.appspot.com/ – it gives you an rss feed of all your public posts (this will only work for public posts sorry). My URL for my rss feed is http://plusfeed.appspot.com/114228869493885222559 , yours will look similar, just grab the id number from your profile page URL and add it after the domain.

Now go to your WordPress , login, to go Plugins > Add New . Search for and find the plugin called FeedWordPress and install/activate it.
Now it should show you your feed in that syndication tab, you can click the ‘update now’ button to load the last few posts.

Now you will notice a new menu bottom left called ‘Syndication’, click on that, then add in the URL above from plusfeed.appspot.com into the box named “New source”. It will confirm the look/feel, and add it.
Now you can click the ‘update’

 

 

 

 

Updating

Now click on the Feeds and Updates menu below it, look for the drop down box and choose ‘Look for updates after page loads’. You can do updates before the page loads, but this means if a person comes to your blog they are sitting waiting for the page to load whilst it does background grabbing of data.
From here you are away working, feel free to fiddle with other settings.

 

I found i prefer the link to go to the blog post rather than link to the google+ link, so i go to Posts and Links menu, and scroll down to Links, then choose ‘The local copy on this website’

 
 

Removing spam users from wordpress with bbforum using SQL

16 Aug

I have a wordpress blog, actually i have a lot of them, which uses the bb forum plugin as well as the main site.
This particular forum attracts a lot of spam signups, this can bog down the database once it gets to the point of over 11k or more, and its a security risk (and pain in the butt). I have implemented several plugins to stop sign ups but they still eventually find their way around things.

So today i decided that i really wanted to be rid of all the users that had not commented or posted on the forum. I had previously found plugins that did this for wordpress itself, but they do not work with the bb forums. Often they check if a person has commented on the wordpress, but not if they have posted on the forum.

Anyway i figured it would be a simple mysql query, so hunted about the forum and made the following up

DELETE FROM wp_users
WHERE wp_users.id NOT
IN (
SELECT user_id
FROM wp_comments
)
AND wp_users.id NOT
IN (
SELECT poster_id
FROM bb_posts
)
AND wp_users.id NOT
IN (
SELECT post_author
FROM wp_posts
)

Then of course you need to hunt out and remove all the other meta data, i used something like this
DELETE FROM wp_usermeta
WHERE wp_usermeta.user_id NOT
IN (
SELECT id FROM wp_users
)

It probably pays to check before deleting, and swap the first “DELETE FROM” for a “SELECT * FROM” to view the data.
It also probably pays to delete the user from wp_usermeta by id and other places (will update later)
Hope this helps somebody, let me know of any other places the data needs to be removed from if you know more.

ps. my PC crashed hard whilst writing this, i lost the exact MySQL query i used so redid this from scratch – let me know if i missed any bits or you get any errors.

 
Comments Off

Posted in Tech

 

Finding a Flash video in chrome – Saving files open but deleted

19 May

Flash movies are online, but sometimes i want to save some for offline usage so i can watch them later or offline (laptops) etc.
Often there is no way to save/download these files, but they are not held in the tmp dir or cache as they used to be due to changes in flash. In Linux this is easy to overcome using the following methods. This also works for any file that’s been deleted but is still running in memory.

First, you need to find what or where the file is. For flash try

velofille@apple:~$ sudo lsof |grep Flash
npviewer.  8774  velofille   16u      REG                9,1 253092771     396153 /tmp/FlashXXDfgiS7 (deleted)
velofille@apple:~$

Bingo, i found my file! Of course the file /tmp/FlashXXDfgiS7 is deleted, so i cant just copy it like the good old days. Now i can copy that file from the proc filesystem using the following

cat /proc/8774/fd/16 > movie.flv

Now to breakdown where i got those parms from. The 8774 is the pid and 2nd number on the line, the 16 was from the ’16u’ which is the file descriptor . So when you do your lsof you can change those according to what you have open.
To find files open from a particular app, use ps to find the pid, then use

lsof -p 8774

Output is something like this

chrome  26572 velofille  mem    REG                9,1  1285536   1836431 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
chrome  26572 velofille  mem    REG                9,1   141088   3146088 /lib/x86_64-linux-gnu/ld-2.13.so
chrome  26572 velofille  DEL    REG               0,16           34257353 /dev/shm/.com.google.chrome.i96CPN
chrome  26572 velofille  DEL    REG               0,16           34257687 /dev/shm/.com.google.chrome.W9M2O5
chrome  26572 velofille  mem    REG                9,1   377352   4587538 /opt/google/chrome/libppGoogleNaClPluginChrome.so
chrome  26572 velofille    0r   CHR                1,3      0t0      5778 /dev/null
chrome  26572 velofille    1u   REG               0,20   953173   5767170 /home/velofille/.xsession-errors
chrome  26572 velofille    2u   REG               0,20   953173   5767170 /home/velofille/.xsession-errors
chrome  26572 velofille    3u   REG               0,20   953173   5767170 /home/velofille/.xsession-errors
chrome  26572 velofille    4r  FIFO                0,8      0t0  34257284 pipe
chrome  26572 velofille    5u  unix 0xffff88002c61f740      0t0  34257940 socket
chrome  26572 velofille    6u  sock                0,7      0t0  34257281 can't identify protocol
chrome  26572 velofille    7u   CHR                1,9      0t0      5783 /dev/urandom

The only ones you can take like this are the ones with a file descriptor to play with.

Good luck, an have fun!

 
Comments Off

Posted in Informative, Tech