Engineering and technology notes

New installation problems – Transmission

Hi all

By way of intoduction: I am no techie but, having run a medium traffic site on my own VPS for 12 months, I guess I’m not a totally tech-dummy either. My VPS is Centos 5.5 and I do most admin with Webmin + a little ssh console stuff. The site’s primary purpose is to host a fairly large MediaWiki installation – software I am now fairly proficient with. VPS is in Ireland and I’m in UK running a small network of windows and linux boxes for different things.

A few months ago I started to host a mirror on the vps. It requires regular updates from large zip files provided exclusively via the bittorrent protocol. I was used to downloading torrents to my home network and began by doing the same with the big zip files and then uploading to the VPS – total waste of bandwidth and time. Enter a clear need for suitable headless server bittorrent software with remote admin for the VPS.

It turns out Centos is NOT the best when it comes to the cutting-edge stuff but I’m stuck with it. I started with the Standard Bittorrent client. Soon became fed up with no Magnet facility or workable remote Web or other GUI – plus other niggles. Tried to graduate to Rtorrent + RUtorrent Web UI. Won’t bore you with the time that wasted – though it had to do with with the near impossibility of compiling Rtorrent with RPC capability on Centos. Anyway, here I am with a working Transmission installation – but issues.

I have the daemon running and the web UI working OK. I can download the files that triggered the need in the first place very well (12Mb in about 30 seconds when unrestricted !!). My problem is that the installation does not seem to want to to do any seeding and neither will it resolve Magnet links. I can’t find any clues in the logs either. The Transmission log simply reports that the seeding has timed-out after the set interval of inactivity and the torrent is paused. If I download the same files to my home machines there is plenty of seeding activity going on so it’s not that there is no demand.

Also, loading a magnet link gets stuck on ‘retrieving metadata’ at 0.00% forever.

Whilst I can currently use it for what I need it’s hardly in the spirit of p2p protocol not to share ANY of it.

Any pointers, observation, suggestions welcome.

Source: New installation problems – Transmission

InstallingANewHardDrive – Community Help Wiki

While it’s not every day that you need to add a new hard drive to your computer, the task does not have to be complicated. Use this guide to help you install a new hard drive with an existing Ubuntu system, and partition it for use. Before beginning, you need to consider for what you will be using the hard drive.

  • Will the drive be used only with Ubuntu?
  • Will the drive need to be accessible from both Ubuntu and Windows?
  • How do you want to divide the free space? As a single partition, or as several?

This guide goes over procedures for a single partition drive install only. Multiple partition drive installations are not very hard, and you may very well figure it out by using this guide; however, make sure you add an entry in /etc/fstab for each partition, not just the drive.

Source: InstallingANewHardDrive – Community Help Wiki

OpenVPN

If you want more than just pre-shared keys OpenVPN makes it easy to setup and use a Public Key Infrastructure (PKI) to use SSL/TLS certificates for authentication and key exchange between the VPN server and clients. OpenVPN can be used in a routed or bridged VPN mode and can be configured to use either UDP or TCP. The port number can be configured as well, but port 1194 is the official one. And it is only using that single port for all communication.

Source: OpenVPN

My simply MySQL Command Line Cheatsheet · GitHub

MySQL

Getting started:

Related tutorials:

Tools:

Commands

Access monitor: mysql -u [username] -p; (will prompt for password)

Show all databases: show databases;

Access database: mysql -u [username] -p [database] (will prompt for password)

Create new database: create database [database];

Select database: use [database];

Determine what database is in use: select database();

Show all tables: show tables;

Show table structure: describe [table];

List all indexes on a table: show index from [table];

Create new table with columns: CREATE TABLE [table] ([column] VARCHAR(120), [another-column] DATETIME);

Adding a column: ALTER TABLE [table] ADD COLUMN [column] VARCHAR(120);

Adding a column with an unique, auto-incrementing ID: ALTER TABLE [table] ADD COLUMN [column] int NOT NULL AUTO_INCREMENT PRIMARY KEY;

Inserting a record: INSERT INTO [table] ([column], [column]) VALUES ('[value]', [value]');

MySQL function for datetime input: NOW()

Selecting records: SELECT * FROM [table];

Explain records: EXPLAIN SELECT * FROM [table];

Selecting parts of records: SELECT [column], [another-column] FROM [table];

Counting records: SELECT COUNT([column]) FROM [table];

Counting and selecting grouped records: SELECT *, (SELECT COUNT([column]) FROM [table]) AS count FROM [table] GROUP BY [column];

Selecting specific records: SELECT * FROM [table] WHERE [column] = [value]; (Selectors: <, >, !=; combine multiple selectors with AND, OR)

Select records containing [value]: SELECT * FROM [table] WHERE [column] LIKE '%[value]%';

Select records starting with [value]: SELECT * FROM [table] WHERE [column] LIKE '[value]%';

Select records starting with val and ending with ue: SELECT * FROM [table] WHERE [column] LIKE '[val_ue]';

Select a range: SELECT * FROM [table] WHERE [column] BETWEEN [value1] and [value2];

Select with custom order and only limit: SELECT * FROM [table] WHERE [column] ORDER BY [column] ASC LIMIT [value];(Order: DESC, ASC)

Updating records: UPDATE [table] SET [column] = '[updated-value]' WHERE [column] = [value];

Deleting records: DELETE FROM [table] WHERE [column] = [value];

Delete all records from a table (without dropping the table itself): DELETE FROM [table]; (This also resets the incrementing counter for auto generated columns like an id column.)

Delete all records in a table: truncate table [table];

Removing table columns: ALTER TABLE [table] DROP COLUMN [column];

Deleting tables: DROP TABLE [table];

Deleting databases: DROP DATABASE [database];

Custom column output names: SELECT [column] AS [custom-column] FROM [table];

Export a database dump (more info here): mysqldump -u [username] -p [database] > db_backup.sql

Use --lock-tables=false option for locked tables (more info here).

Import a database dump (more info here): mysql -u [username] -p -h localhost [database] < db_backup.sql

Logout: exit;

Aggregate functions

Select but without duplicates: SELECT distinct name, email, acception FROM owners WHERE acception = 1 AND date >= 2015-01-01 00:00:00

Calculate total number of records: SELECT SUM([column]) FROM [table];

Count total number of [column] and group by [category-column]: SELECT [category-column], SUM([column]) FROM [table] GROUP BY [category-column];

Get largest value in [column]: SELECT MAX([column]) FROM [table];

Get smallest value: SELECT MIN([column]) FROM [table];

Get average value: SELECT AVG([column]) FROM [table];

Get rounded average value and group by [category-column]: SELECT [category-column], ROUND(AVG([column]), 2) FROM [table] GROUP BY [category-column];

Multiple tables

Select from multiple tables: SELECT [table1].[column], [table1].[another-column], [table2].[column] FROM [table1], [table2];

Combine rows from different tables: SELECT * FROM [table1] INNER JOIN [table2] ON [table1].[column] = [table2].[column];

Combine rows from different tables but do not require the join condition: SELECT * FROM [table1] LEFT OUTER JOIN [table2] ON [table1].[column] = [table2].[column]; (The left table is the first table that appears in the statement.)

Rename column or table using an alias: SELECT [table1].[column] AS '[value]', [table2].[column] AS '[value]' FROM [table1], [table2];

Users functions

List all users: SELECT User,Host FROM mysql.user;

Create new user: CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';

Grant ALL access to user for * tables: GRANT ALL ON database.* TO 'user'@'localhost';

Find out the IP Address of the Mysql Host

SHOW VARIABLES WHERE Variable_name = 'hostname'; (source)

Source: My simply MySQL Command Line Cheatsheet · GitHub

Gil Amelio

Gilbert Frank “Gil” Amelio (born March 1, 1943) is an American technology executive. Amelio worked at Bell Labs, Fairchild Semiconductor, and the semiconductor division of Rockwell International but is best remembered as a CEO of National Semiconductor and Apple Inc.

Source: Gil Amelio – Wikipedia