UPWORK/ODESK guru: Tips and Tricks for clients

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

Archive for the ‘Tips and Tricks’ Category

BASH: сохраняем историю со всех терминалов

with one comment

Меня давно раздражает поведение файла истории Баша. Если вы используете несколько терминалов, вся история теряется, за исключением закрытия последнего терминала. Правильное поведение должно состоять в том, чтобы сохранить всю историю со всех терминалов! Легкий способ сделать это – просто сохранить команды в файле истории в реальном времени. Благодаря Linux Commando я знаю, как это сделать. Вот секрет:

1
2
shopt -s histappend
PROMPT_COMMAND = "history -a; $ PROMPT_COMMAND"

Поместите эти строки в ваш bash_profile или bashrc. Первая строка говорит bash добавить к истории вместо полной перезаписи. Вторая строка вызывает историю – каждый раз, когда отображается приглашение, которое по существу добавляет последнюю команду в файл истории.

Written by spectre

November 27th, 2017 at 1:42 pm

Posted in Bash,Tips and Tricks

Openstack Horizon: Bug of ‘FileField need clean up temp file….’ or how to remove supefluos files in Horizon/Django after uploading..

without comments

After few day envestigation code I created patch. I hope core developers can use it in horizon …

1
2
3
4
5
6
7
8
9
10
11
12
13
14
234 @@ -442,7 +442,12 @@
235                                      {'data': data})
236          else:
237              def upload():
238 -                return glanceclient(request).images.upload(image.id, data)
239 +                glance_answer = glanceclient(request).images.upload(image.id, data)
240 +                if isinstance(data, TemporaryUploadedFile):
241 +                   if glance_answer[0].ok is True :
242 +                      data.file.close_called = False
243 +                      data.file.close()
244 +                return glance_answer
245              thread.start_new_thread(upload, ())
246
247      return Image(image)

Enjoy! Free!

Written by spectre

November 19th, 2017 at 5:16 pm

Posted in Tips and Tricks

BUGS of OPENSTACK: broken dependency of version of openstack-novaclient in tarballs of horizon-9.1.2

without comments

WRONG!!!

1
2
3
(.venv) [homitaka@tayn1 horizon]$ egrep novaclient requirements.txt
python-novaclient!=2.33.0,>=2.29.0 # Apache-2.0
(.venv) [homitaka@tayn1 horizon]$

Read the rest of this entry »

Written by spectre

May 15th, 2017 at 9:29 pm

Posted in Tips and Tricks

Deploy Horizon (any releases) from tarballs with Apache for isolated user in virtual environment.

without comments

If your company use OpenStack clouds without ‘Horizon Dashboard’ interface, you may wish to deploy your own horizon instance. Or you can use this method for permanent deploy any version of Horizont in your clouds.

However, your concern is that http might be insecure… especially if hosted on a VM or machine accessible from the Internet. So you want an SSL connection. It is will be in next parts of articles

ref: https://docs.openstack.org/developer/horizon/topics/install.html

Read the rest of this entry »

Written by spectre

May 15th, 2017 at 1:01 am

Posted in Tips and Tricks

Protected: Apache 2.4 and compilation mod_wsgi for alternative python version.

without comments

This content is password protected. To view it please enter your password below:

Written by spectre

March 2nd, 2017 at 3:33 pm

Posted in Tips and Tricks

Linux – configuring multicast – via C application.

without comments

Configuring the Kernel for multicast

ref: http://www.linuxjournal.com/article/3041

To use multicast, the kernel configuration requires the CONFIG_IP_MULTICAST option to be set.
Use ifconfig to enable and disable all-multicast mode. Disable promisc by running:

Read the rest of this entry »

Written by spectre

May 21st, 2016 at 2:26 pm

Posted in Tips and Tricks

CSF: IP tracking of DNS name – perl tool

without comments

Simple code on perl for tracking of list of IP of DNS name:

Read the rest of this entry »

Written by spectre

July 21st, 2015 at 4:13 pm

Posted in Tips and Tricks

MosSecurity: ErrorDocument 403

without comments

Precon.:
ErrorDocument 403 http://servername.com/403.php
> apachectl -M | grep uniq
unique_id_module (shared)

file: 403.txt.tar

Written by spectre

July 20th, 2015 at 2:10 pm

Posted in Tips and Tricks

Files robots.txt for WordPress – (War with Google)

without comments

– So Allow does not work in Google? Only Disallow?
– There is no such thing as Allow in the robots.txt standard. You can only Disallow things… BUT:

Google accepts some syntax which is not included in The standard and they spell out how to use it. Allow is an acceptable way to have google crawl a few specific files when all of them are disallowed as a default such as Disallow: /*.php. If it didn't work like that they would not be able to retrieve my php sitemaps which they are doing regularly.

This is how you can disallow "all" and allow "some" for Google, it needs to be in this order:
Disallow: /directory/*.asp
Allow: /directory/filename.asp
Allow: /directory/filename-2.php

I looked it up so you can go and read more about it if you like:

https://www.webmasterworld.com/r.cgi?f=93&d=4699148&url=http://support.google.com/webmasters/answer/6062596

Permalink version (Custom – /%category%/%postname%.php):

Read the rest of this entry »

Written by spectre

July 8th, 2015 at 3:21 pm

Posted in Tips and Tricks,WP

WordPress: Disable automatic redirect. Site on separate ports (Nginx+Apache: 3080/3081)

without comments

You can turn off canonical redirection by putting this into your plugins directory:
Read the rest of this entry »

Written by spectre

July 7th, 2015 at 6:47 pm

Posted in Tips and Tricks,WP