0x76 LINUX - EMERGENCY REBOOT

If you find yourself in this situation (and I hope you won’t!), you have some options to get your way with a misbehaving server remotely. You can force an immediate reboot with the following:

echo 1 > /proc/sys/kernel/sysrq 
echo b > /proc/sysrq-trigger

WHOA THERE! This is pretty much the same as pressing the reset button on the server (if equipped). No daemons will be shut down gracefully, no filesystem sync will occur, and you may get the wrath of a fsck (or worse, a non-booting server) upon reboot.

linux admin

 

0x75 TCPDUMP - GREP 80 REQ

sudo tcpdump -A -s 10240 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | egrep --line-buffered "^........(GET |HTTP\/|POST |HEAD )|^[A-Za-z0-9-]+: " | sed -r 's/^........(GET |HTTP\/|POST |HEAD )/\n\1/g' 
admin

 

0x74 SYMFONY - ENTITY VALIDATION

app/config/config.yml

validation:      { enabled: true, enable_annotations: false }

Bundle/Resources/config/validation.yml

Bundle\Entity\Post:
    properties:
        name:
            - NotBlank: ~
        text:
            - NotBlank: ~

Controller

$entity = new Entity();
$validator = $this->get('validator');
$errors = $validator->validate($entity);
if (count($errors)>0) {
} else {
}
symfony php

 

0x6f INSTALL CX_ORACLE ON CENTOS 7

  1. Download and install oracle client from Oracle
yum install libaio
rpm -Uvh oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
rpm -Uvh oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
rpm -Uvh oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm
  1. Add Oracle client to library path
echo "/usr/lib/oracle/12.1/client64/lib" >/etc/ld.so.conf.d/oracle.conf
ldconfig
  1. install epel repo via yum extra
yum install epel-release
  1. Install additional
yum install gcc python-pip.noarch python-devel
  1. Install cx_Oracle via pip
pip install cx_Oracle
linux oracle python centos

 

0x72 INSTALL VNC-SERVER, UBUNTU

Загрузить пакеты XFCE и TightVNC можно из программного репозитория Ubuntu с помощью apt:

sudo apt-get update
sudo apt-get install xfce4 xfce4-goodies tightvncserver

Для завершения начальной настройки сервера VNC используйте команду vncserver, которая создаст безопасный пароль:

vncserver

Continue reading →

linux

 

0x6e HARRY POTTER THEME

E -----0----3-2-0---7--5----2--0---3--2------2-----
B --0-------------------------------------3------0-

E -----0----3-2-0---7--10---9-8---5---8-7-6---2--7-
B --0----------------------------------------------

E -3--7---3--7---3--8--7--6----2--3---8-7-6---2--7—

E -3--7---3--7---3--10--9–-8---5---8-7-6---5--2------0-
B ------------------------------------------------0----