Wednesday, December 21, 2016

Connection refused after yum update

Hi,

I had run yum update command and server updated and installed about 300 different module with kernel. After update complete, webserver(apache) and server didn't reachable. Webserver and ssh connections was said that "Connection refused"

I'm using centos 7.2 and the update include the upgrade to centos 7.3
After a reboot, the server does not change anything. On the last yum update, too many modules have been updated, so I connect in rescue mode and check all the updates the system has done.

sudo yum history list all



sudo yum history info 34































  • Check theses configuration files if theses does not change
    • etc/hosts
    • ect/networks
    • etc/host.conf
    • etc/resolve.conf
    • etc/network/interfaces
  • Mount Disk
    • fdisk -l
    • mount /dev/hda1 /mnt/
    • mount /dev/hda2 /mnt/home/
    • mount -t proc proc /proc
  • You have to chroot yourself on your partition
    • chroot /mnt/
  • Disable firewall
    • systemctl disable firewalld
Source : 

Friday, December 16, 2016

How to temporarily disable a foreign key constraint in MySQL ?

Try DISABLE KEYS or
SET FOREIGN_KEY_CHECKS=0;
make sure to
SET FOREIGN_KEY_CHECKS=1;
after.

Source : http://stackoverflow.com/questions/15501673/how-to-temporarily-disable-a-foreign-key-constraint-in-mysql

Tuesday, December 13, 2016

How To Use Find and Locate to Search for Files on a Linux

https://www.digitalocean.com/community/tutorials/how-to-use-find-and-locate-to-search-for-files-on-a-linux-vps

Save MySQL query results into a text or CSV file

MySQL provides an easy mechanism for writing the results of a select statement into a text file on the server. Using extended options of the INTO OUTFILE nomenclature, it is possible to create a comma separated value (CSV) which can be imported into a spreadsheet application such as OpenOffice or Excel or any other applciation which accepts data in CSV format.
Given a query such as
SELECT order_id,product_name,qty FROM orders
which returns three columns of data, the results can be placed into the file /tmo/orders.txt using the query:
SELECT order_id,product_name,qty FROM orders
INTO OUTFILE '/tmp/orders.txt'
This will create a tab-separated file, each row on its own line. To alter this behavior, it is possible to add modifiers to the query:
SELECT order_id,product_name,qty FROM orders
INTO OUTFILE '/tmp/orders.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
In this example, each field will be enclosed in “double quotes,” the fields will be separated by commas, and each row will be output on a new line separated by a newline (\n). Sample output of this command would look like:
"1","Tech-Recipes sock puppet","14.95" "2","Tech-Recipes chef's hat","18.95"
...
Keep in mind that the output file must not already exist and that the user MySQL is running as has write permissions to the directory MySQL is attempting to write the file to.

Thursday, October 20, 2016

Disabled and read-only controls

Check this out : https://www.w3.org/TR/html401/interact/forms.html#disabled

Tuesday, October 4, 2016

Eviter d'etre marqué comme spam par google

Ci joint le message :

This is the mail system at host xxxxx

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system

<mail@qmail.com> (expanded from  mail@domain.com): host
    gmail-smtp-in.l.google.com[2a00:1450:400c:c07::1a] said: 550-5.7.1
    [2001:41d0:1004:21bc::      12] Our system has detected that this 550-5.7.1
    message is likely unsolicited mail. To reduce the amount of spam sent
    550-5.7.1 to Gmail, this message has been blocked. Please visit 550-5.7.1
    https://support.google.com/mail/?p=UnsolicitedMessageError 550 5.7.1  for
    more information. l130si4589472wmf.42 - gsmtp (in reply to end of DATA
    command)

Final-Recipient: rfc822; mail@gmail.com
Original-Recipient: rfc822;mail@domain.com
Action: failed
Status: 5.7.1
Remote-MTA: dns; gmail-smtp-in.l.google.com
Diagnostic-Code: smtp; 550-5.7.1 [2001:41d0:1004:21bc::      12] Our system has
    detected that this 550-5.7.1 message is likely unsolicited mail. To reduce
    the amount of spam sent 550-5.7.1 to Gmail, this message has been blocked.
    Please visit 550-5.7.1
    https://support.google.com/mail/?p=UnsolicitedMessageError 550 5.7.1  for
    more information. l130si4589472wmf.42 - gsmtp

Extrait :

Il vous faut simplement éditer vos zones DNS chez votre registrar, pour y ajouter une entrée de type TXT. L'instruction pour la cas décrit précédemment est :
v=spf1 a mx ip4:<IP> -all
Paramètres :
  • spf1 : la version de SPF
  • a : s'applique au A-record courant
  • mx : s'applique à l'entre MX courante
  • ip4<IP> : n'accepte que l'IP spécifiée (IP du serveur)
  • -all : refuse tous les autres
Ci joint la solution  : http://wiki.hoa.ro/doku.php?id=admin-systeme:mail-server-marked-as-spam-google

Wednesday, September 21, 2016

[Security] Switching Users with HTTP Basic Auth does not work

https://github.com/symfony/symfony/issues/8260

A part of the discussion
I'm experiencing an issue with HTTP Basic Auth and the SwitchUserListener. The symptoms are that switching users just does not work:
  • The firewall is configured with stateless: false and switch_user: true
  • When attempting to GET /<existing_path>?_switch_user=<valid_other_user>, the SwitchUserListenerredirectes to /<existing_path>.
  • The active token still points to the 'old' user.
After some research, I found out that this behaviour is caused by two things:
  1. The BasicAuthenticationListener is built in a way that should prevent credentials being checked again when the current token is already authenticated. This condition (among others) is being tested in line 64 and evaluates to false since $token->getUsername() !== $username. This results in the token withROLE_PREVIOUS_ADMIN to be overwritten in SecurityContext (line 75).
  2. Apparently persisting a token with ROLE_PREVIOUS_ADMIN does not work as expected. There already is anissue for this to which I added a comment.
In general, I don't know whether this is a bug or a feature that was never planned, but I would really appreciate some feedback on this. Switching users when providing the user's credentials with every request might sound strange, but there are cases in which this makes perfect sense.
Thank you in advance,