How to fix W: Duplicate sources.list entry http://apt.newrelic.com/debian/ newrelic/non-free amd64 Packages (/var/lib/apt/lists/apt.newrelic.com_debian_dists_newrelic_non-free_binary-amd64_Packages)

How to fix this error ?

W: Duplicate sources.list entry http://apt.newrelic.com/debian/ newrelic/non-free amd64 Packages (/var/lib/apt/lists/apt.newrelic.com_debian_dists_newrelic_non-free_binary-amd64_Packages)

This comes on my hosting once you typed in apt-get update.

The resolution is pretty simple if you know where to look to for and they don’t make it easy.

Instead of navigating to

$cd /etc/apt/

you need to navigate to:

# cd /etc/apt/sources.list.d/ and edit newrelic file

it might just simpler to type:

$vim /etc/apt/sources.list.d/newrelic.list

and edit to file from:

deb http://apt.newrelic.com/debian newrelic non-free

deb http://apt.newrelic.com/debian newrelic non-free

So you need to remove one line and run apt-get update again.

Problem solved!

Or simply you can use this command to find where it is

grep -rnw /etc/ -e “deb http://apt.newrelic.com/debian”
/etc/apt/sources.list.d/newrelic.list:1:deb http://apt.newrelic.com/debian/ newrelic non-free

how to fix SSL/TLS Diffie-Hellman Modulus <= 1024 Bits (Logjam) 25 / tcp / smtp CVE-2015-4000

This is short version of guide from  here (https://weakdh.org/sysadmin.html)

Generate a 2048 key using openssl

openssl dhparam -out dhparams.pem 2048

and then reconfigure postfix

Postfix SMTP

Both parameters should be set in /etc/postfix/main.cf.

Add

smtpd_tls_exclude_ciphers = aNULL, eNULL, EXPORT, DES, RC4, MD5, PSK, aECDH, EDH-DSS-DES-CBC3-SHA, EDH-RSA-DES-CDB3-SHA, KRB5-DES, CBC3-SHA

Add

smtpd_tls_dh1024_param_file = ${config_directory}/dhparams.pem

Reload configuration

sudo postfix reload

This will fix your postfix installation and your server will be PCI compliant again.

How to Open CSV files using iMacro

1. Let’s make it happened.

The below is just an example which will not work for you as I am using it on bespoke system.

‘open 1 tab only type

TAB T=1
‘ignore errors. this is to allow proceed with macro even if the ip has already been removed
SET !ERRORIGNORE YES
‘wait 2 second instead of default 6s if errors occurs (to speed up the work also sometimes you need to increase because the web page might not appear in the right time and some steps will be missing)
SET !TIMEOUT_PAGE 2
‘set up datasource (this is where the CSV is)
SET !DATASOURCE bulk_reconfiguring.csv
‘ you need to specify the number of rows
SET !DATASOURCE_COLUMNS 2
‘set up loop ( this is what will be repeated from 1 row as the loop is setup as 1 next loop is basically a next row)
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
‘open a device search do some work and repeat with the next row
‘ you can see that the {{!COL1}} is build in variable from iMacro this is where your data from CSV will be.
URL GOTO=http://xx.xx.xx/ABLDevice
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:OSSMeta-filter-form ATTR=ID:edit-Value CONTENT={{!COL1}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:OSSMeta-filter-form ATTR=ID:edit-submitonce
TAG POS=1 TYPE=A ATTR=TXT:{{!COL1}}

How to use Javascript with iMacro and find out the end of file in CSV file.

1. Once you recorded your Macro using iMacro you need to change to file to (.js) extension. This will enable you to use javascript code inside to macro to give what you need.

Example of use of JavaScript can be found here on my Github account.

https://github.com/ber5ien/imacros_scripts/blob/master/javascript/daily_calls_update_v2.js

This piece of code will be found at the finish of CSV files so you can iterate over rows in cvs files.

This is very useful with imacro otherwise you need to type in manually how many rows you got in to CSV files.

 

datasource – this is path to your datasource C://…

Hylas – this can be ignored 🙂

csv_file_name = your csv name which need to be put into Datasource directory.

function count_rows(datasource,hylas,csv_file_name)
{
 // COUNT THE NUMBERS OF ROWS IN CSV FOR LOOP
 const CRLF = “\r\n”;
 const LF = “\n”;
 
 var lines = new Array();
 
 var file_i = imns.FIO.openNode(datasource+hylas+csv_file_name);
 var text = imns.FIO.readTextFile(file_i); // Read file into one string
 
 // Determine end-of-line marker
 var eol = (text.indexOf(CRLF) == -1) ? LF : CRLF;
 
 // Split into lines (number of lines) NUMBER OF LINES IN CSV
 lines = text.split(eol);
 eol = lines.length;
 //iimDisplay(eol);
 // FINISH COUNTING EOL = NUmber of LInes
 return eol;
}

SSD Hosting for 5 dollars a month https://www.digitalocean.com/?refcode=71a52388956e

Web Automation with iMacro Software. No more repetetive task! Boost your Web Productivity

Hi Guys,

I though I will share some of my knowledge regards the automation tool and how you can improve your work and any repetitive task.

What we need first is to get right tools for the job. You can use any

1. iMacro Software (Free)

http://imacros.net/overview

You can see my scripts on GitHub

https://github.com/ber5ien/imacros_scripts/tree/master/imacros_scripts

The one based on Javascript. This will give you some more flexibility as you can use them to change your iMacros scripts depending on some data which you can scrap/export from web itself

https://github.com/ber5ien/imacros_scripts/tree/master/javascript

2. Firefox 🙂

http://www.mozilla.org/firefox/new/

3. Some plugins! ( will add some plugins soon )

xMark – Save your bookmarks and sync them anywhere

Autofill Forms – You can use this to automate filling some forms. You can predefine forms so then you can just right click and select the one you need. This is a great tool especially for any web based ticketing systems.

InstantFox – Search Via your Address. This can save few click as you can open some pages directly for instance : open g – This would open a website named as g.

MyWords – You can predefined some sentence and they use keyboard shortcut to it.

4. Let’s get started. I will just give you a quick introduction to it. It’s a quite nice tool and you can use their api to integrate it with language such as vb script php javascript etc.

5.What you need to do first is to records your Macro. Press F8 to get the info then you can start recording.

Once you finish your imacro script you can then see current.imm file which contain what you have recorded.

This is just a beginning more to go which I will be posting soon.

Secure Server – Hardening Tips & Tricks. Make your server more secure.

Server Hardening Tips & Tricks:

Found it on the net but let’s make it better. Post your COMMENTS!

 

Is that really all ?

Every server security conscious organization will have their own methods for maintaining adequate system and network security. Often you will find that server hardening consultants can bring your security efforts up a notch with their specialized expertise.

Some common server hardening tips & tricks include:

– Use Data Encryption for your Communications
– Avoid using insecure protocols that send your information or passwords in plain text.
– Minimize unnecessary software on your servers.
– Disable Unwanted SUID and SGID Binaries
– Keep your operating system up to date, especially security patches.
– Using security extensions is a plus.
– When using Linux, SELinux should be considered. Linux server hardening is a primary focus for the web hosting industry, however in web hosting SELinux is probably not a good option as it often causes issues when the server is used for web hosting purposes.
– User Accounts should have very strong passwords
– Change passwords on a regular basis and do not reuse them
– Lock accounts after too many login failures. Often these login failures are illegitimate attempts to gain access to your system.
– Do not permit empty passwords.
– SSH Hardening
— Change the port from default to a non standard one
— Disable direct root logins. Switch to root from a lower level account only when necessary.
– Unnecessary services should be disabled. Disable all instances of IRC – BitchX, bnc, eggdrop, generic-sniffers, guardservices, ircd, psyBNC, ptlink.
– Securing /tmp /var/tmp /dev/shm
– Hide BIND DNS Sever Version and Apache version
– Hardening sysctl.conf
– Server hardenining by installing Root Kit Hunter and ChrootKit hunter.
– Minimize open network ports to be only what is needed for your specific circumstances.
– Configure the system firewall (Iptables) or get a software installed like CSF or APF. Proper setup of a firewall itself can prevent many attacks.
– Consider also using a hardware firewall
– Separate partitions in ways that make your system more secure.
– Disable unwanted binaries
– Maintain server logs; mirror logs to a separate log server
– Install Logwatch and review logwatch emails daily. Investigate any suspicious activity on your server.
– Use brute force and intrusion detection systems
– Install Linux Socket Monitor – Detects/alerts when new sockets are created on your system, often revealing hacker activity
– Install Mod_security as Webserver Hardening
– Hardening the Php installation
– Limit user accounts to accessing only what they need. Increased access should only be on an as-needed basis.
– Maintain proper backups
– Don’t forget about physical server security

yum install error File “/usr/bin/yum”, line 30 except KeyboardInterrupt on Cent OS Ubuntu Linux Mint Redhat

This is a common problem if you updated your python distribution to python 3. Normally installed python from source.

 

Unfortunately yum still depend on the python 2

What you need to do is:

$which python

Then navigate normally to:

$cd /usr/bin/

$ll | grep python

and see what is happening:

lrwxrwxrwx    1 root root           9 Feb 22 17:10 python -> python2.6
lrwxrwxrwx    1 root root           6 Nov  9 12:04 python2 -> python
-rwxr-xr-x    1 root root        9032 Jul 10  2013 python2.6

In my case I have already fixed this problem so you can see that my symlink python -> python2.6

if it point to something else then you need to type in:

ln -s python2.6 python

You can use any other version of python you have got installed as long as it is version 2