This time i will show you, how to install Aircrack-ng on CentOS 7. My CentOS 7 (CentOS Linux release 7.2.1511 x64) is a virtual maschine on VirtualBox (5.0). As wireless USB Adapter i use TP-Link TL-WN822N.
Before we start, if you don`t know what is profiling read this Wikipedia article! In my opinion profiling should be a part of every development/build process! Whether the responsibility lies with QA or development. Python profiler are supported only in PyCharm Professional Edition. This article show you the possibilities for the community edition.
With Unix/Linux time command you have allready a simple profiler! Time writes a message to standard output. Here you will find some information on Stackoverflow.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def hello_world():
for i in range(1, 5):
print '%d Hello world from python...' % i
if __name__ == '__main__':
hello_world()
With BashSupport Plugin we can setup the “Run/Debug Configuration” like:
Better informations
But now we need better information. For this we use cProfile, cprofilev and snakeviz.
# cProfile is part of standard python library
# install snakeviz
$ pip install snakeviz
# install cprofildev
$ pip install cprofilev
“Run/Debug Configuration” example
Now will store the results into a file
With snakeviz you can open the profile in browser:
$ snakeviz output.prof
The other option is to use cprofilev:
Even more information
If that was not enough,… we install some more libraries.
Now we need to change the example code. We add the decorator…
#!/usr/bin/env python
# -*- coding: utf-8 -*-
@profile
def hello_world():
for i in range(1, 5):
print '%d Hello world from python...' % i
if __name__ == '__main__':
hello_world()
the line_profiler configuration
the memory_profiler
All configurations could now startet via the “Run” button. There are even more Profiler that you can use with similar PyCharm.
Of course you can run Ansible within PyCharm via command-line, but it also works with the “Run” button.
Preparation
PyCharm project created (maybe with virtualenv)
YAML/Ansible support Plugin installed (optional)
BashSupport Plugin installed
Configuration
Open “Run/Debug Configurations” and add new Bash configuration. Give a name and Script value. The value should be the main Ansible playbook. As Interpreter path value select the ansible-playbook binary. For Interpreter option insert the Ansible inventory file. The last value is your current working directory. If you don’t set this value, the values for playbook and inventory need configured with absolute path!
Now you can create different configurations and run Ansible via “Run” button.
As a software tester or developer you are using operating systems such as RHEL, CentOS and Fedora. It may happen that the hard disk space is running at the limit and a further update is no longer possible. An easy way to create free space is to delete the kernel(s) of older versions.
Steps
# check for all (old) kernels
$ rpm -q kernel
By default 5 kernels will be stored.
Change configuration
# change configuration
$ vim yum.conf
# limit value and save
installonly_limit=2
# update
$ yum -y update
Delete unused (old) kernels
# install yum-utils
$ yum install yum-utils
# cleanup with value for old kernels you want left
$ package-cleanup --oldkernels --count=2
If you use Python virtualenv, pylint and lxml together, you may see error messages in pylint test results. It`s because only trusted C extension resources (the standard library) should be used. Here is an opportunity to improve the pylint test results.
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=lxml
If you now perform the pylint test again, no error relating to lxml should appear.