Шаблоны контейнеров в Virtuozzo. Оперативное развертывание контейнеров Денис Силаков # vzpkg install template centos-6-x86_64 # vzpkg remove template -F centos-6-x86_64 mysql # vzpkg install template centos-6-x86_64 # vzpkg create cache # vzpkg list # vzpkg list –available # vzpkg list --available centos* # prlctl create c1 --vmtype=ct --ostemplate=centos-6-x86_64 # prlctl start c1 # vzpkg install c1 mysql # vzpkg update c1 centos-6-x86_64 # vzpkg remove c1 mysql # man vzpkg.metafile # yum install vztt-build # man vzpkg.metafile # vzmktmpl --pre-cache pre-cache --pre-upgrade pre-upgrade metafile ----------------------------------------------------------------------------------------- Поддержка филиалов средствами MDOP Александр Пичкасов msra /offerra Install-WindowsFeature WDS -IncludeAllSubFeature –IncludeManagementTools Import-WdsBootImage –Path C:\Users\Administrator\Desktop\DaRT8.1\x64\boot.wim –NewImageName "HelpDesk DaRT 8.1 (x64) –DisplayOrder 0 DartRemoteViewer.exe –ticket=619-691-521 –ipaddress=10.10.0.40 –port=3388 ----------------------------------------------------------------------------------------- Защита от DDoS подручными средствами. Часть 1. DNS Amplification Андрей Дугин client:~$ dig @192.168.10.128 google.com dns-server# tcpdump -n -s 0 host 192.168.10.129 and port 53 client:~$ dig @192.168.10.128 -t ANY google.com dns-server# tcpdump -n -s 0 host 192.168.10.129 and port 53 client:~$ netstat -nap | egrep 'udp|tcp' client:~$ netstat -nap | egrep 'udp|tcp' net.ipv6.conf.all.disable_ipv6 = 1 $ sudo sysctl -p /etc/sysctl.conf allow-transfer {"none";}; allow-recursion {"none";}; recursion no; acl "trusted_ip" { 192.168.0.0/16; 10.0.0.0/8; localhost; localnets; }; options { allow-recursion { trusted_ip; }; allow-query-cache { trusted_ip; }; }; client:~$ dig @192.168.10.128 -t ANY irs.gov slip 2 responses-per-second 5 $ dig -t ANY qwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiop123.northwesternmutual iptables -N DNS_ANY iptables -v -A DNS_ANY -m recent --name dns_any --update --seconds 10 --hitcount 3 -j DROP iptables -v -A DNS_ANY -m recent --name dns_any --set -j ACCEPT iptables -v -A INPUT -p udp --dport 53 -m string --from 40 --to 123 --algo bm --hex-string '|0000FF00|' -j DNS_ANY CE(config-if)# ip verify unicast source reachable-via rx ----------------------------------------------------------------------------------------- Проводим пентест. Часть 2. Сбор необходимой информации Андрей Бирюков root@kali:~# nmap –sS -O 192.168.1.0/24 root@kali:~# nmap -sV -p 22,53,110,143,4564 198.168.1.1-127 root@kali:~# nmap -v -iR 100000 -PN -p 80 root@kali:~# nmap -PN -p80 -oX logs/pb-port80scan.xml -oG logs/pb-port80scan.gnmap 216.163.128.20/20 root@kali:~# masscan -p порты опции root@kali:~# masscan -p80,7000-7100 10.0.0.0/8 --rate=100000 root@kali:~# masscan -p80 10.0.0.0/8 --banners -oB <имя_файла> root@kali:~# masscan 10.0.0.0/8 –p137-139 --adapter-ip 192.168.1.111 --adapter-mac 00-11-22-33-44-55 adapter-ip = 192.168.1.111 adapter-mac = 00-11-22-33-44-55 root@kali:~# masscan -c <имя_файла> root@kali:~# ettercap –G root@kali:~# echo 1 > /proc/sys/net/ipv4/ip_forward root@kali:~# arpspoof –t 192.168.1.1 192.168.1.100 root@kali:~# arpspoof –t 192.168.1.100 192.168.1.1 root@kali:~# dsniff ----------------------------------------------------------------------------------------- Распараллеливание операций в Oracle. Часть 2. Особенности и ограничения Владимир Тихомиров; Валерий Михеичев Select name, value, description from v$parameter where name like ‘%parallel%’ order by 1; Select u.username, p.profile, p.resource_name, p.limit from dba_profiles p, dba_users u where u.profile=p.profile and resource_name ='SESSIONS_PER_USER' and u.username='AIF'; Select name,value from v$parameter where name='resource_limit'; Select name, isdefault, value from v$ses_optimizer_env s where sid = sys_context('USERENV', 'SID') and name like 'parallel%' order by 1; Alter session enable parallel DML Alter session force parallel DML Alter session force dml Alter session force dml parallel 32 CREATE TABLE AIF. TARIFF ( ISN NUMBER, NAME VARCHAR2(200), PRICE NUMBER, HEADISN NUMBER) PARTITION BY RANGE (HEADISN) INTERVAL( 100) ( PARTITION P_1 VALUES LESS THAN (100)) PARALLEL 32; Select p.* from dba_tab_partitions p where p.table_owner='AIF' and p.table_name=’TARIFF' order by partition_position; PARALLEL (DEGREE DEFAULT INSTANCES DEFAULT) Select value*(select value from v$parameter where name='parallel_threads_per_cpu')+1 from v$parameter where name='cpu_count'; Update /*+ parallel(32) */ aif.tariff set price=price+100 where isn=1000000; commit; Alter table aif.rtariff parallel 64 Select /*+ parallel(32) * / t.* from aif.tariff t… Select /*+ parallel(32) */ t.* from aif.tariff partition(sys_p48283) t; Select * from v$px_session where qcsid=241 Select sid from v$session where audsid in (select userenv('sessionid') from dual) Select /*+ parallel(a 32) */ a.* from aif.buch_t a Create table aif.buch_t (…) parallel 32 Alter table aif.buh_t parallel 16 Select degree from all_tables where owner='AIF' and table_name='BUH_T' Alter table aif.buh_t noparallel Alter session force parallel query parallel 32 Select count(*) from v$px_session Select sql_id, (select v.sql_text from v$sql v where v.sql_id=s.sql_id and rownum=1) sql_text, p.* ,s.* from v$process p,v$session s where s.paddr=p.addr and p.pname like 'P%' order by s.sid; Create table aif.buh_t parallel 32 as select /*+ parallel(32) */ * from aif.buh_isx; Select degree from all_index where owner='AIF' and index_name='X_BUH_T' Create index aif.x_buh_t_isn on aif.buh_t(isn) parallel 32 nologging online tablespace prise Alter index имя индекса parallel 32 Select degree, i.* from dba_indexes i where index_name='X_BUH_T_ISN' Alter index aif.x_buh_t_isn rebuild parallel 32 online nologging Select timestamp, u.name owner,o.name table_name,m.inserts, m.deletes, m.updates from sys.mon_mods$ m, sys.obj$ o,sys.user$ u where o.owner#=u.user# and o.obj#=m.obj# and u.name='AIF' and o.name='BUH_T'; Execute dbms_stats.gather_table_stats ('aif','obj_attrib',null,20,null, 'for all indexed columns size auto',32); Execute dbms_stats.gather_index_stats ('aif', 'x_attrib, null,20, degree=>32); Execute dbms_stats.gather_index_stats ('aif', 'x_test_statist_ISN', null,20, null, null, null, 32); Create index aif.x_attrib…parallel 32 Alter index aif.x_attrib parallel 32 ----------------------------------------------------------------------------------------- Под капотом платформы 1С 8.3. Часть 1. Работа с СУБД Олег Филиппов SET LOCK_TIMEOUT 20000 SET TRANSACTION ISOLATION LEVEL READ COMMITTED SELECT TOP 2147483647 ID, Name, Descr, OSName, Changed, RolesID, Show, Data, EAuth, AdmRole, UsSprH FROM v8users WITH(READCOMMITTED) ----------------------------------------------------------------------------------------- Пишем мобильные приложения быстрее. Паттерн Наблюдатель и реактивное программирование Андрей Пахомов public class CheckServer extends Observable{ public void isServerOnline(String url){ NetworkClient nClient = new NetworkClient(url); if (!nClient.getRequest()){... if (!nClient.getRequest()){ setChanged(); notifyObservers();}} public class SmsSender implements Observer { @Override public void update(Observable observable, Object data) {sendSms();} private void sendSms(){ SmsManager alertSms = SmsManager.getDefault(); alertSms.sendTextMessage(number,null,text,null,null);} public class Notify implements Observer { @Override public void update(Observable observable, Object data) { makeBeep();}...} CheckServer netRqv = new CheckServer(); Notify notify = new Notify(); SmsSender smsSender = new SmsSender("+7999...", "Wake up, something happened!"); netRqv.addObserver(notify); netRqv.addObserver(smsSender); netRqv.deleteObserver(smsSender); repositories {maven { url 'https://oss.jfrog.org/libs-snapshot' }} compile 'io.reactivex:rxjava:1.1.2-SNAPSHOT' Observable.just(new NetworkFunc().isServerOnline("server.addr")) .subscribe(new Subscriber() {... @Override public void onNext(Object o) { notify.showNotification(); smsSender.sendSms();}}); Observable.just(new NetworkFunc().isServerOnline("server.addr")) .delay(5,TimeUnit.SECONDS).repeat().subscribe(new Subscriber() {... .filter(new Func1() { @Override public Boolean call(Integer integer) { return integer>90;} Single.just(new NetworkClient("a").getRequest())... Observable.just(JsonObject.create()).subscribeOn(Schedulers.newThread())... compile 'io.reactivex:rxandroid:1.1.0' Observable.just(mathOperation).subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Action1() { @Override public void call(Integer integer) { textView.setText(integer.toString());}}); ----------------------------------------------------------------------------------------- Автоматизируем отчетность по Cucumber-тестам в ExtentReports Анна Сергеева com.vimalselvam cucumber-extentsreport 1.0.0 @RunWith(Cucumber.class) @CucumberOptions(plugin = {"com.cucumber.listener.ExtentCucumberFormatter:"}) public class RunCukesTest { } @RunWith(Cucumber.class) @CucumberOptions(plugin = {"com.cucumber.listener.ExtentCucumberFormatter:output/report.html"}) public class RunCukesTest { } @RunWith(Cucumber.class) @Cucumber.Options(features = "target/test-classes/cucumber/examples/", tags = {"@search"}, format = {"html:target/cucumber-report/search"}) public class RunCukesTest { } java -jar extentmerge.jar -dir "C:\MyDirectory" -out "C:\PublicDirectory\ExtentMerge.html" java -jar extentmerge.jar -html "C:\MyDirectory\Report1.html" -html "C:\MyDirectory\Report2.html" -out "C:\PublicDirectory\ExtentMerge.html" java -jar extentmerge.jar -dir "locataion" -out "extent.html" -from "2016-01-02 00:00:00" -to "2016-03-04 23:59:59" java -jar extentmerge.jar -dir "location" -out "extent.html" -css-file "css.css" java -jar extentmerge.jar -dir "location" -out "extent.html" -js-file "script.js" java -jar extentmerge.jar -dir "location" -out "extent.html" -css ".tag { display: none; }" java -jar extentmerge.jar -dir "location" -out "extent.html" -js "$(document).ready(function() { alert('hello world'); });" ----------------------------------------------------------------------------------------- Построение сайтов с использованием Hack Александр Календарев

Hello !

echo "

Hello $word !

"; echo

Hello {$word}!

; echo

Hello {$word}!; { "require": { "facebook/xhp-lib": "~2.2" } } hhvm composer include 'vendor/autoload.php'; include 'vendor/autoload.php'; final class :a:post extends :x:element { attribute :a; use XHPHelpers; protected function render(): XHPRoot { $id = $this->getID(); $anchor = {$this->getChildren()}; $form = (

:href} target={$this->:target} class="postLink" >{$anchor}
); $this->transferAllAttributes($anchor); $anchor->setAttribute( 'onclick', 'document.getElementById("'.$id.'").submit(); return false;', ); $anchor->setAttribute('href', '#'); return $form; } } $post_link = переход через POST запрос; echo $post_link; echo ; function renderIcon(User $user): XHPRoot { return getIconURI()} />   {$user->getName()} ; } function build_list(array $names): XHPRoot { $list =
    ; foreach ($names as $name) { $list->appendChild(
  • {$name}
  • ); } return $list; } $fruits = ["яблоки", "апельсины", "бананы"]; echo build_list($fruits); $hhvm ex0.php
    • яблоки
    • апельсины
    • бананы
    class :hello-world extends :x:element { protected function render(): XHPRoot { return Hello World; } } echo ; $hhvm ex3.php Hello World echo ; class :top extends :x:element { attribute string title; attribute string description; use XHPHelpers; protected function render(): XHPRoot { $description = $this->getAttribute("description"); return {$this->:title}