Chris' Blog

Just another WordPress site

Page 2 of 9

Nexus 6P Screen Replacement done!

I just got my phone back from Huawei with a brand new screen. I called Jul 20th to support to get the ball rolling, sent it out shortly thereafter to Texas, and I just got it back today. So about 3 weeks to get a phone screen replaced and a cost of $163.46 for the repair and $18 for shipping UPS to them (181.46 total). Much cheaper than the going through Asurion  who wanted to give me a different device and the deductible was about the same. Overall, I’m happy with Huawei and their support, it was easy to call and talk immediately with people who handled my claim quickly and professionally. For comparison Asurion put me on hold for 30 or so minutes and I just gave up.

Adobe Account Snafu

I’ve been a Creative Cloud member for over a year without any problems whatsoever. I am in the process of retiring an old e-mail address and went to setup the new one on Adobe.com. In the process my account has disappeared! I specified a new account id and an alternate, now none of them work except the alternate, but my membership details have been deleted. Support didn’t resolve the issue, I’m not sure if they could have since I doubt they have much access to anything. So, as a result I just cancelled the subscription in Paypal to Adobe and will begin a trial in my alternate account until I need to pay again. I’m glad I didn’t store anything in their cloud servers as it would be gone by now. Who knows what really happened, its probably in a log file somewhere.

What Solar does to your electric bill

First full month with solar, I wish all my bills were expected to be negative:

electric-bill

Slightly more than 1 MWh was generated this month:

solarcity-june-2016

Thanks to the sun for powering my house and also making life on Earth possible.

I realize again I need to blog more.

I’m not sure why, but I feel the need to blog a bit more, so I’m going to try and make a post a day. I’ll be on vacation coming up soon which might make it tough but I’ll try!

So far: I’ve done 6 days of p90x3 — starting up again and hope to continue.

Getting some things done around the house: Solar panels have been installed w/ new panel. Next up:

  1. New Patio including concrete, side walkway, and patio cover.
  2. Air Conditioning.
  3. Master bath remodel late August

Some minor things I need to do this weekend:

  1. Hang medicine cabinet I bought months ago.
  2. Landscaping in the front.
  3. Closet organizers for master and Inny’s room.
  4. Cabinet for A/V equipment.
  5. Prime and Paint stucco around windows and old panel.

What to do with political advertising.

Just throw it out, search the internet for candidates and familiarize yourself with them before voting. We get so much of this in the mail I think its rather insane. The past couple of weeks I’ve been getting at least one flier like this a day.

Brand new server

So it was costing me the price of a dedicated server to host in the Google Cloud so I switched back to Linode.com for this blog. I’ve spun up a new server to teach myself containers and have docker running 3 at the moment. This new blog should be alive soon after DNS settings propagate.

Inny wanted to start a youtube channel.

Innocence has been watching some kids play with toys videos on Youtube almost non-stop before I took her laptop away because that’s all she did. But I did allow her to start her own channel with my help editing and running the camera. So far its a lot of fun, she seems to enjoy assembling toys and making videos. Next up I need to start teaching her how to edit videos.

Her channel is available here: Inny’s Magical Castle. Her first video is posted below:

 

This is running in a container

Kuberenetes on Google Cloud specifically. Just thought I’d see how it looks and works. Now I’ve moved my production blog over from my self-hosted linode. Running WordPress in a container with a separate MySQL container is working well!

Some features I really like over my roll-it-yourself approach:

  1. Upgrades are now seamless, no more update notifications, the docker container is setup to allow auto-updating.
  2. Plugins don’t need to be installed manually, they just install.
  3. Same with themes!
  4. Themes are easily customizable, no more mucking with permissions.
  5. It seems faster, but that may be because its running on a separate server from MySQL.

Openstack Server

I’ve been playing with Openstack a bit at work and at home. I purchased an Lenovo TD340 a while ago and have been playing a bit with Devstack. Right now I have neutron networking and glusterfs installed on it. It took a bit of work to get it working so I thought I’d share my local.conf file showing how to add a plugin to devstack and how to configure networking, since the documentation for me was not complete. I’m on a 10.0.0.0/8 network at home, the openstack devstack server is 10.0.0.5, and my router is 10.0.0.1.


[[local|localrc]]
enable_plugin devstack-plugin-glusterfs https://github.com/stackforge/devstack-plugin-glusterfs

#Enable heat services
enable_service h-eng h-api h-api-cfn h-api-cw

# Minimal Contents
# ----------------
ADMIN_PASSWORD=securepassword
DATABASE_PASSWORD=stackdb
RABBIT_PASSWORD=stackqueue
SERVICE_PASSWORD=$ADMIN_PASSWORD
HOST_IP=10.0.0.5

# Logging
# -------
LOGFILE=$DEST/logs/stack.sh.log
LOGDAYS=2

# Swift
# -----
SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
SWIFT_REPLICAS=1
SWIFT_DATA_DIR=$DEST/data

# Neutron options
# ---------------

# Do not use Nova-Network
disable_service n-net

# Enable Neutron
ENABLED_SERVICES+=,q-svc,q-agt,q-dhcp,q-l3,q-meta,neutron,q-lbaas

Q_USE_SECGROUP=True
FLOATING_RANGE="10.0.5.0/8"
FIXED_RANGE="192.168.0.0/24"
Q_FLOATING_ALLOCATION_POOL=start=10.0.5.10,end=10.0.5.250
PUBLIC_NETWORK_GATEWAY="10.0.0.1"
Q_L3_ENABLED=True
PUBLIC_INTERFACE=enp7s0
Q_USE_PROVIDERNET_FOR_PUBLIC=True
OVS_PHYSICAL_BRIDGE=br-ex
PUBLIC_BRIDGE=br-ex
OVS_BRIDGE_MAPPINGS=public:br-ex
#NETWORK_GATEWAY=10.0.0.1
NETWORK_GATEWAY=192.168.0.1

# Glusterfs
# ---------
CINDER_ENABLED_BACKENDS=glusterfs
CONFIGURE_GLUSTERFS_GLANCE=True
CONFIGURE_GLUSTERFS_NOVA=True
CONFIGURE_GLUSTERFS_CINDER=True
CONFIGURE_GLUSTERFS_MANILA=True

vBulletin to Discourse conversion.

I’m in the process of trying to move from vBulletin on a forum to Discourse and I’m having a bit of a hard time. There are no instructions on running the importing script so its taking a bit longer than it should. I’ll work to document what I’m trying in this post to help others who might have a difficult time.

Discourse looks great and works really well. Plus combined with docker its very simple to setup from scratch, upgrade, backup, and restore. Plus its free and vBulletin hasn’t really added any great features and Discourse is kicking its ass. The forum in question is currently at: technobadger.com, which used to be the old forums at psx-dude.net — my first domain from long ago.

I first started by following the docker instructions for discourse to get it setup:

I made a backup of my vBulletin MySQL database and copied it onto my test machine into a database called `technobadger_production`. Don’t forget to create a user that can access remotely.

[code]
mysql> GRANT ALL ON technobadger_production.* TO ‘technobadger_r’@’%’
IDENTIFIED BY ‘sX55ot6FJ#q#3%Ms’ WITH GRANT PRIVILEGES;
mysql> FLUSH PRIVILEGES;
[/code]

You’ll also need to let the mysql server listen for remote connections. You can edit the /etc/mysql/my.cnf and comment out the following line. Don’t forget to restart mysql for the changes to take effect.
[code]# bind-address 127.0.0.1[/code]
I copied the attachments folder into `/home/chris/attachments`. I copied the attachments into the container:
[code]
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b7764d41d245 local_discourse/app:latest "/sbin/boot" 29 hours ago Up 29 hours 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:2222->22/tcp app
[/code]
I copied changed into the root of the container:
[code]
cd /var/lib/docker/aufs/mnt/b7764d41d245394cf5d7f7e44cdd2c7bd2866fe2a42dd5572357e4fb760a3c7a
mkdir attachments && cd attachments
cp -R /home/chris/vb-attachments/attachments/* ./
[/code]
Change into the discourse directory: `cd /var/discourse` and launch into the docker:
[code]
./launcher enter app
cd /var/www/discourse
apt-get update && apt-get install libmysqlclient-dev
gem install mysql2
[/code]
I edited the script/import_scripts/vbulletin.rb file and changed the top lines to represent the database i installed on the container host (outside of the container) and added an entry for password. 10.0.0.128 is the ip of my main server that has mysql on it.

 

[code]
class ImportScripts::VBulletin < ImportScripts::Base
BATCH_SIZE = 1000

# CHANGE THESE BEFORE RUNNING THE IMPORTER
DATABASE = "technobadger_production"
TIMEZONE = "America/Los_Angeles"
ATTACHMENT_DIR = ‘/attachments’

def initialize
super

@old_username_to_new_usernames = {}

@tz = TZInfo::Timezone.get(TIMEZONE)

@htmlentities = HTMLEntities.new

@client = Mysql2::Client.new(
host: "10.0.0.128",
username: "technobadger_r",
password: "sX55ot6FJ#q#3%Ms",
database: DATABASE
)
end
[/code]

I edited the Gemfile in `/var/www/discourse` and added the following line to the end:
[code]gem `mysql2`[/code]
and then ran…
[code]bundle install –no-deployment[/code]
I modified the Postgres config file (/etc/postgresql/9.3/main/pg_hba.conf) to change everything to trust for the import. Obviously don’t use this on your production server as that could be bad.
[code]
# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks).
#
# Database administrative login by Unix domain socket
# local all postgres peer # Chris: Replaced with line below
local all postgres trust

# TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only
#local all all peer # Chris: Replaced with line below
local all all trust
# IPv4 local connections:
host all all 0.0.0.0/0 md5
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication postgres peer
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5
[/code]
I had to modify the importer script because some of my avatars didn’t have a file extension or were empty. Below is a diff of my changes for this file:

[code]
@@ -110,7 +111,11 @@ class ImportScripts::VBulletin < ImportScripts::Base
file.write(picture["filedata"].encode("ASCII-8BIT").force_encoding("UTF-8"))
file.rewind

– upload = Upload.create_for(imported_user.id, file, picture["filename"], file.size)
+ if picture[‘filename’].nil?
+ upload = Upload.create_for(imported_user.id, file, "anyfile.jpg", file.size)
+ else
+ upload = Upload.create_for(imported_user.id, file, picture["filename"], file.size)
+ end

return if !upload.persisted?

[/code]

I also had some forums that didn’t have parents in them. I had to update them manually:

[code]
mysql> SELECT forumid, title, description, displayorder, parentid FROM forum WHERE parentid NOT IN ( SELECT forumid FROM forum ) AND parentid <> -1 ORDER BY forumid;
+———+——————-+———————————————————————————————————————————————————————–+————–+———-+
| forumid | title | description | displayorder | parentid |
+———+——————-+———————————————————————————————————————————————————————–+————–+———-+
| 15 | Sub-forum 1 | Sub-forum1 description | 1 | 14 |
| 16 | Sub-forum 2 | Description | 1 | 14 |
| 19 | Talk about TDRM | | 1 | 18 |
| 20 | Editing | | 1 | 18 |
| 21 | Clans | | 1 | 18 |
| 23 | Newbie Discussion | | 1 | 22 |
| 26 | My Scripts | Having a problem with one of my scripts, want to see other people using it, or have a comment or request for a feature. Or still even have a code hack, post it here. | 1 | 25 |
+———+——————-+———————————————————————————————————————————————————————–+————–+———-+
7 rows in set (0.00 sec)

mysql> UPDATE forum SET parentid = 1 WHERE forumid IN (15,16,19,20,21,23,26);
Query OK, 7 rows affected (0.00 sec)
Rows matched: 7 Changed: 7 Warnings: 0
[/code]

Then I ran the following under the /var/www/discourse
[code] # rails runner script/import_scripts/vbulletin.rb[/code]

« Older posts Newer posts »

© 2018 Chris' Blog

Theme by Anders NorenUp ↑