Downgrade Nuget package

As of Nuget 2.8 there is a feature to downgrade a package.

Nuget 2.8 Release Notes

Example:

The following command entered into the Package Manager Console will downgrade the couchbase client to version 1.3.1.0

Update-Package CouchbaseNetClient -Version 1.3.1.0

Result:

Updating 'CouchbaseNetClient' from version '1.3.3' to '1.3.1.0' in project [project name].
 Removing 'CouchbaseNetClient 1.3.3' from [project name].
 Successfully removed 'CouchbaseNetClient 1.3.3' from [project name].

Something to note as per crimbo below:

“this approach doesn’t work for downgrading from one prerelease version to other prerelease version – it only works for downgrading to a release version”

Source: http://stackoverflow.com/questions/10206090/how-to-install-an-older-version-of-package-via-nuget

Instalar certificado SSL no Apache

https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-httpd-secure-server.html#private-signed-cert

https://www.linode.com/docs/security/ssl/ssl-certificates-with-apache-2-on-centos

Converter chaves:
http://stackoverflow.com/questions/8774574/how-can-i-convert-a-pfx-certificate-file-for-use-with-apache-on-a-linux-server

Mais do que um certificado por domínio:
http://serverfault.com/questions/392149/domains-and-subdomains-virtualhosts-with-different-ssl-certificates

https://www.digicert.com/ssl-support/apache-multiple-ssl-certificates-using-sni.htm

https://www.digicert.com/ssl-certificate-installation-apache.htm

Configure Munin to graph MySQL on CentOS 5/6

If you’re running a CentOS 5/6 Server and installed Munin to graph the system stats, you’ll mostly likely notice that the generated graphs do not include MySQL.

Unfortunately, by default, Munin tries to read MySQL data using the root account and no password and fails.

But there’s an easy way to fix this:

Enter your MySQL Database Server administration interface and create a new user munin with a safe password (remember it, you’ll need it later), set it to only log in from localhost and add the Superuser permission.

Then navigate to Database Permissions and add the previously created munin user on database mysql, again only for localhost and only grant the Select table data permission.

Moving on, open the /etc/munin/plugin-conf.d/munin-node file in your favourite editor and add (or edit if already exists):

[mysql*]
env.mysqladmin /usr/bin/mysqladmin
env.mysqluser munin
env.mysqlpassword your-previously-defined-password

If you’re using innodb tables, you will need to create the /etc/munin/plugin-conf.d/mysql_innodb file and this in it to ignore error about it (which Munin will most likely generate):

[mysql_innodb]
env.warning 0
env.critical 0

Now it’s time to test if the plugin works. Run in the console:

munin-node-configure --suggest | grep mysql

You should get something like

mysql_                     | yes  | yes (+bin_relay_log +commands +connections +files_tables +innodb_bpool +innodb_bpool_act +innodb_insert_buf +innodb_io +innodb_io_pend +innodb_log +innodb_rows +innodb_semaphores +innodb_tnx +myisam_indexes +network_traffic +qcache +qcache_mem +replication +select_types +slow +sorts +table_locks +tmp_tables)

If you’re missing any required Perl modules, you’ll see a | no | no and the needed modules’ names.

mysql_                     | no   | no [Missing dependency Cache::Cache]

Install them and then try again.

yum install perl-Cache-Cache perl-IPC-ShareLite

If all is well, it’s time to activate the plugin by running

ln -s /usr/share/munin/plugins/mysql_* /etc/munin/plugins

and then restart munin-node

service munin-node restart

Then just wait 10-20 minutes for your graphs to show up.

Fail2ban unban IP

Since 0.8.8 there is the unbanip option. It can be triggered by the set command.

fail2ban-client set ssh-iptables unbanip m.y.i.p

more generic:

fail2ban-client set :jail unbanip :ip

Syntaxis

Instalar plugin Java no Firefox (CentOS)

Java must be installed on the system first. This procedure only works with the version you download from Oracle; it will not work with the OpenJDK version of Java you’ll have when using the ‘yum install java’ command.

Download Linux x64 RPM from Oracle’s Java Downloads for All Operating Systems page.

Close Firefox.

Change to root user and enter password.

su

Change directory to /usr/java. If it isn’t created, create it.

mkdir /usr/java
cd /usr/java

Execute rpm on the Java RPM you just downloaded…

rpm -ivh /home/basejump/Downloads/jre-7u21-linux-x64.rpm

Validate with:

java -version

Delete the original RPM; you don’t need that anymore.

rm -rf /home/basejump/Downloads/jre-8u60-linux-x64.rpm

From the /usr/java directory, Find the Firefox plugin (which gets installed with java):

find . | grep libnpjp

For me, that returned:

/usr/java/jre1.8.0_60/lib/amd64/libnpjp2.so

Change to directory for Firefox plugins:

cd /usr/lib64/mozilla/plugins

Be careful. There is also a /usr/lib/mozilla/plugins directory. Be sure you’re in lib64!

Create symbolic link to the plugin:

ln -fs /usr/java/jre1.8.0_60/lib/amd64/libnpjp2.so libnpjp2.so

Start Firefox and validate by going to Tools > Addons > Plugins. You should now see Java Plug-in 1.x.x enabled.

MySQL is blocked because of many connection errors

More rarely, it can happen when the client is attempting the initial connection to the server. In this case, if your connect_timeout value is set to only a few seconds, you may be able to resolve the problem by increasing it to ten seconds, perhaps more if you have a very long distance or slow connection. You can determine whether you are experiencing this more uncommon cause by using SHOW STATUS LIKE ‘aborted_connections’. It will increase by one for each initial connection attempt that the server aborts. You may see “reading authorization packet” as part of the error message; if so, that also suggests that this is the solution that you need.

Try increasing connect_timeout in your my.cnf file

Another style:

MySQL: Lost connection to MySQL server at ‘reading initial communication packet’

  1. At some point, it was impossible for remote clients to connect to the MySQL server.
  2. The client (some application on a Windows platform) gave a vague description like Connection unexpectedly terminated.
  3. When remotely logging in with the MySQL client the following error appeared:
    ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0

On FreeBSD this happens because there was no match found in /etc/hosts.allow. Adding the following line before the line saying ALL:ALL fixes this:

mysqld: ALL: allow

On non-FreeBSD Unix systems, it is worth to check the files /etc/hosts.allow and /etc/hosts.deny. If you are restricting connections, make sure this line is in /etc/hosts.allow:

mysqld: ALL

or check if the host is listed in /etc/hosts.deny.

In Arch Linux, a similar line can be added to /etc/hosts.allow:

mysqld: ALL

Clamscan

Check all files on the computer, but only display infected files:

clamscan -r -i /home/eb23marrazes/public_html/

Check files in the USER home directory and remove infected files (WARNING: Files are gone.):

clamscan -r --remove /home/eb23marrazes/public_html/