UPWORK/ODESK guru: Tips and Tricks for clients

skype: upwork.link , email: [email protected]

Archive for October, 2013

Best way to link Redmine issue to SVN revision

without comments

Q

We are using Redmine for issue and bug tracking. We added SVN integration but, by doing this, it just shows SVN revisions in activity. It would be great to see all SVN changes caused by a bug or issue. But it does not seem to be possible.Is there a way to do that? If not Redmine, which is the best alternative tracking system to achieve this?

We add the issue number in svn commit message and it’s recognized automatically.

Read the rest of this entry »

Written by spectre

October 31st, 2013 at 8:56 pm

Posted in Svn,Tips and Tricks

Forcing a hard disk to reallocate bad sectors

without comments

Sometimes a hard disk is hinting on an upcoming failure. Some disks start to make unexpected sounds, others are silent and only cause some noise in your syslog. In most cases the disk will automatically reallocate one or two damaged sectors and you should start planning on buying a new disk while your data is safe. However, sometimes the disk won’t automatically reallocate these sectors and you’ll have to do that manually yourself. Luckily, this doesn’t include any rocket science.

Read the rest of this entry »

Written by spectre

October 31st, 2013 at 8:08 am

Posted in Arrays and Disks

CGI – web status of system’s command.

without comments

#!/usr/bin/perl

use strict;
use warnings;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);

#print header(-type=>'text/plain');
print header( -charset => 'utf-8', -refresh => '10' );
print start_html();

my $info1 = `cat /proc/mdstat`;

print "...html";

print end_html();

Written by spectre

October 28th, 2013 at 10:16 pm

Posted in Perl,Tips and Tricks

Copy Master Boot Record (MBR)

without comments

How do I copy MBR from one hard disk to another hard disk?

To copy MBR simply use the dd command. dd command works under all Linux distros and other UNIX like operating systems too. A master boot record (MBR) is the 512-byte boot sector that is the first sector of a partitioned data storage device of a hard disk.

Read the rest of this entry »

Written by spectre

October 26th, 2013 at 9:31 pm

Posted in Arrays and Disks

Mysql: import and export

without comments

Экспорт и импорт данных в MySQL обычно требуется при переносе информации из одной базы данных MySQL в другую и для осуществления резервного копирования.
Резервное копирование данных носит чисто технологический характер. Это означает, что в случае какого-либо программного или аппаратного сбоя оборудования, будет возможность восстановить актуальные данные.
Единственный способ быть уверенным в 100% восстановлении данных — самостоятельно выполнять регулярное резервное копирование информации. Для этого необходимо воспользоваться утилитой mysqldump, которая доступна через unix shell.

Пример команд для экспорта и импорта базы данных:

mysqldump -u имя_пользователя -p -h имя_сервера_БД имя_базы > dump.sql

Read the rest of this entry »

Written by spectre

October 22nd, 2013 at 6:35 pm

Posted in Mysql

How to monitor file access on Linux with auditd

without comments

If you are running a mission critical web server, or maintaining a storage server loaded with sensitive data, you probably want to closely monitor file access activities within the server. For example, you want to track any unauthorized change in system configuration files such as /etc/passwd.

To monitor who changed or accessed files or directories on Linux, you can use the Linux Audit System which provides system call auditing and monitoring. In the Linux Audit System, a daemon called auditd is responsible for monitoring individual system calls, and logging them for inspection.

In this tutorial, I will describe how to monitor file access on Linux by using auditd.

To install auditd on Debian, Ubuntu or Linux Mint:

Read the rest of this entry »

Written by spectre

October 19th, 2013 at 1:01 pm

Posted in Tips and Tricks

vim regex how to …

without comments

Written by spectre

October 19th, 2013 at 12:14 pm

Posted in Tips and Tricks,Vim

Apache: .htaccess redirect from HTTP to HTTPS.

without comments

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)
RewriteRule ^.*$ https://%1/$1 [R=301,L]

OR

Read the rest of this entry »

Written by spectre

October 11th, 2013 at 10:28 pm

The Fool’s Guide to CGI.pm

without comments

No, this guide is not for fools but by a fool, who had kept wondering how CGI.pm is supposed to work and finally got a clue. So here’s how (I think) it works in simplest cases. I hope this might make some other people’s learning curve a little better.

Read the rest of this entry »

Written by spectre

October 4th, 2013 at 3:49 pm

Posted in Perl