windows history console command

1 install clink

2 echo c:\Users\%username%\AppData\Local\clink\.history > %systemroot%\history.cmd

Рубрика: admin, windows | Оставить комментарий

autoit array examples

#include <Array.au3>

Local $arr_internal_1[3] = [«1», «2», «3»]
_ArrayDisplay($arr_internal_1, «$arr_internal_1»)
#cs
Row|Col 0
[0]|00
[1]|10
[2]|20
#ce

Local $arr_internal_2[2][3] = [[«1″,»2″,»3»], _
[«4″,»5″,»6»]]
_ArrayDisplay($arr_internal_2, «$arr_internal_2»)
Local $row = 1, $column = 10
If isElement2DExists($arr_internal_2, $row, $column ) Then
If $arr_internal_2[$row][$column] < 3 Then
MsgBox($MB_SYSTEMMODAL, «!», $arr_internal_2[$row][$column]&»<3″)
Else
MsgBox($MB_SYSTEMMODAL, «!», $arr_internal_2[$row][$column]&»>=3″)
EndIf
EndIf

Func isElement2DExists($array, $row, $column)
If $row > UBound($array, $UBOUND_ROWS )-1 OR  $column > UBound($array, $UBOUND_COLUMNS  )-1 Then ; row or column is out of the array bounds
Return False ; element is out of the array bounds
EndIf
Return True ; element is in array bounds
EndFunc

Func isElementExists($array, $element)
If $element > UBound($array)-1 Then Return False ; element is out of the array bounds
Return True ; element is in array bounds
EndFunc

Local $element = 4
If isElementExists($arr_internal_1, $element) Then
If $arr_internal_1[$element] < 3 Then
MsgBox($MB_SYSTEMMODAL, «!», «<3»)
Else
MsgBox($MB_SYSTEMMODAL, «!», «>=3»)
EndIf
EndIf

Local $arr_external_1[1] = [$arr_internal_1]
_ArrayDisplay($arr_external_1, «$arr_external_1»)

Local $aArray_Base[2][1] = [[«Item 0 — 0»], _
[«Item 1 — 0»]]
_ArrayDisplay($aArray_Base, «2D — Base array»)
#cs
Row|Col 0
[0]|Item 0 — 0
[1]|Item 1 — 0
#ce

Local $aArray_Base[1][2] = [[«Item 0 — 0», «Item 0 — 1»], _
[]]
_ArrayDisplay($aArray_Base, «2D — Base array»)
#cs
Row|Col 0      |Col 1
[0]|Item 0 — 0|Item 0 — 1
#ce
Local $aArray_Base[1][2]
$aArray_Base[0][0] = «Item 0 — 0»
$aArray_Base[0][1] = «Item 0 — 1»
_ArrayDisplay($aArray_Base, «!2D — Base array»)
#cs
Row|Col 0|Col 1
[0]|Item 0 — 0|Item 0 — 1
#ce

Local $aArray_Base[2][2] = [[«Item 0 — 0», «Item 0 — 1»], _
[«Item 1 — 0», «Item 1 — 1»]]
_ArrayDisplay($aArray_Base, «2D — Base array»)
#cs
Row|Col 0|Col 1
[0]|Item 0 — 0|Item 0 — 1
[1]|Item 1 — 0|Item 1 — 1
#ce

Local $aArray_Base[2][2] = [[«Item 0 — 0», $arr_internal_1], _
[«Item 1 — 0», $arr_internal_1]]
_ArrayDisplay($aArray_Base, «2D — Base array»)
#cs
Row|Col 0|Col 1
[0]|Item 0 — 0|{Array}
[1]|Item 1 — 0|{Array}
#ce
$arr = $aArray_Base[0][1]
_ArrayDisplay($arr, «$arr»)

Local $aArray_Base[2][2]
$aArray_Base[0][0]  = «Item 0 — 0»
$aArray_Base[0][1] =  $arr_internal_1
$aArray_Base[1][0] = «Item 1 — 0»
$aArray_Base[1][1] = $arr_internal_1
_ArrayDisplay($aArray_Base, «2D — Base array»)
#cs
Row|Col 0|Col 1
[0]|Item 0 — 0|{Array}
[1]|Item 1 — 0|{Array}
#ce
$arr = $aArray_Base[0][1]
_ArrayDisplay($arr, «$arr»)

Local $aArray_Base[0][2]
For $i = 0 To 1
ReDim $aArray_Base[$i + 1][2]
$aArray_Base[$i][0]  = «Item » & $i & » — 0″
$aArray_Base[$i][1] =  $arr_internal_1
Next
_ArrayDisplay($aArray_Base, «redim 2D — Base array»)
#cs
Row|Col 0|Col 1
[0]|Item 0 — 0|{Array}
[1]|Item 1 — 0|{Array}
#ce

Рубрика: programming | Оставить комментарий

bootrstrap, retina and ios

model Size IN’ pixel (px) point (PT)
4s 4 640×960 320×480
5 4 640×1136 320×568
5s 4 640×1136 320×568
6 4,7 750×1334 375×667
6s 4,7 750×1334 375×667
6 plus 5,5 1080×1920 375×667
6s plus 5,5 1242×2208 414×736
Ipad 2 9,7 768×1024 768×1024
Ipad air 9,7 1536×2048 768×1024
Ipad air 2 9,7 1536×2048 768×1024
Ipad pro 12,9 2048×2732 1024×1366
Ipad retina 1536×2048 768×1024

Boostrap grid system breakpoints (in POINTS!):

<768pt (xs)

>=768pt (sm)

>=992pt (md)

>=1200pt (lg)

See variables.less (str 281):

//== Media queries breakpoints
//## Define the breakpoints at which your layout will change, adapting to different screen sizes. (@screen-sm, @screen-md, @screen-lg)

So, best approach for disigner’s mockups width is:

640px for retina phone(half sized copy with 320px width image for non-retina phone)

768px for non-retina tablet ( and 1536??px for retina tablets)

1280px (for desktop)(retina needed??)

For implimentation see «picturefill» project ( http://scottjehl.github.io/picturefill/ ) and

http://retinaimag.es/ project.

 

LINKS http://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions

http://iosres.com/

http://getbootstrap.com/css/#grid-options

 

Рубрика: iphone, programming, web | Оставить комментарий

git remote repo to web server deploy

A) Create  repo (local and remote) and push local to remote

[On local machine]

mkdir temp

cd temp

vim test.txt

[insert]some text

[escape]:wq

git init

git add *.*

git commit -m 'First commit.'

cd ..

2) copy files to ftp server (to public_html)

[On server]
1) ssh to server
2) cd /home/c/cd42777
3) $ ls
public_html
4) $ git init --bare --shared temp.git
Initialized empty shared Git repository in /home/c/cd42777/temp.git/

[ON LOCAL]

$ git remote add origin ssh://cd42888@caritas.hoster.ru:/home/c/cd42777/temp.git
$ git remote 
origin
$ git push origin master    //(Enter pass)

____________________________________

B) Create empty folder and get from remote repo
[ON LOCAL]

$git clone ssh://cd42888@caritas.hoster.ru:/home/c/cd42777/temp.git temp
vim test2.txt

[insert]some text2

[escape]:wq
git add .
git commit -m "2nd commit"
git push origin master

C) create hook for auto deploy file on ftp 
[ON SERVER]
nano temp.git/hooks/post-receive
#!/bin/sh
GIT_WORK_TREE=/home/c/cd42777/public_html git checkout -f

$chmod +x  temp.git/hooks/post-receive


LINKS
http://toroid.org/git-website-howto
http://superuser.com/questions/801568/git-put-an-existing-repository-on-a-shared-server
http://eax.me/git-commands/
Рубрика: admin, internet, web | Оставить комментарий

android filesystem

Filesystem               Size     Used     Free   Blksize
/dev                   445.7M   128.0K   445.6M   4096
/sys/fs/cgroup         445.7M    12.0K   445.7M   4096
/mnt/asec              445.7M     0.0K   445.7M   4096
/mnt/obb               445.7M     0.0K   445.7M   4096
/system                530.8M   475.3M    55.5M   4096
/custpack              991.9M   714.4M   277.5M   4096
/data                    5.0G     2.2G     2.8G   4096
/cache                 325.5M   336.0K   325.1M   4096
/persist                27.5M   148.0K    27.3M   4096
/tctpersist              5.8M    40.0K     5.8M   4096
/persist/data            5.8M    84.0K     5.7M   4096
/firmware               64.0M    45.0M    18.9M   16384
/mnt/shell/emulated      5.0G     2.2G     2.8G   4096
/storage/emulated/legacy     5.0G     2.2G     2.8G   4096
/storage/sdcard0         5.0G     2.2G     2.8G   4096

+sd card

Filesystem               Size     Used     Free   Blksize
/dev                   445.7M   128.0K   445.6M   4096
/sys/fs/cgroup         445.7M    12.0K   445.7M   4096
/mnt/asec              445.7M     0.0K   445.7M   4096
/mnt/obb               445.7M     0.0K   445.7M   4096
/system                530.8M   475.3M    55.5M   4096
/custpack              991.9M   714.4M   277.5M   4096
/data                    5.0G     2.2G     2.8G   4096
/cache                 325.5M   336.0K   325.1M   4096
/persist                27.5M   148.0K    27.3M   4096
/tctpersist              5.8M    40.0K     5.8M   4096
/persist/data            5.8M    84.0K     5.7M   4096
/firmware               64.0M    45.0M    18.9M   16384
/mnt/shell/emulated      5.0G     2.2G     2.8G   4096
/storage/sdcard1         7.5G   560.8M     7.0G   4096
/storage/emulated/legacy     5.0G     2.2G     2.8G   4096
/storage/sdcard0         5.0G     2.2G     2.8G   4096
/mnt/media_rw/sdcard1     7.5G   560.8M     7.0G   4096

 

+debian

Filesystem               Size     Used     Free   Blksize
/dev                   445.7M   128.0K   445.6M   4096
/sys/fs/cgroup         445.7M    12.0K   445.7M   4096
/mnt/asec              445.7M     0.0K   445.7M   4096
/mnt/obb               445.7M     0.0K   445.7M   4096
/system                530.8M   475.3M    55.5M   4096
/custpack              991.9M   714.4M   277.5M   4096
/data                    5.0G     2.9G     2.1G   4096
/cache                 325.5M   348.0K   325.1M   4096
/persist                27.5M   148.0K    27.3M   4096
/tctpersist              5.8M    40.0K     5.8M   4096
/persist/data            5.8M    84.0K     5.7M   4096
/firmware               64.0M    45.0M    18.9M   16384
/mnt/shell/emulated      5.0G     2.9G     2.1G   4096
/storage/sdcard1         7.5G   601.2M     6.9G   4096
/storage/emulated/legacy     5.0G     2.9G     2.1G   4096
/storage/sdcard0         5.0G     2.9G     2.1G   4096
/mnt/media_rw/sdcard1     7.5G   601.2M     6.9G   4096
/data/debian           591.5M   213.9M   377.7M   4096
/data/debian/tmp       453.6M     0.0K   453.6M   4096
/data/debian/mnt/sdcard     5.0G     2.9G     2.1G   4096
/data/debian/cache     325.5M   348.0K   325.1M   4096
/data/debian/data        5.0G     2.9G     2.1G   4096
/data/debian/mnt/asec   445.7M     0.0K   445.7M   4096
/data/debian/mnt/obb   445.7M     0.0K   445.7M   4096
/data/debian/mnt/shell/emulated     5.0G     2.9G     2.1G   4096
/data/debian/storage/emulated/legacy     5.0G     2.9G     2.1G   4096
/data/debian/storage/sdcard0     5.0G     2.9G     2.1G   4096
/data/debian/storage/sdcard1     7.5G   601.2M     6.9G   4096
/data/debian/system    530.8M   475.3M    55.5M   4096

 

ONLY debian shell

root@localhost:~# uname -a
Linux localhost 3.10.28-g9d29dcd #1 SMP PREEMPT Mon Jun 1 15:21:17 CST 2015 armv7l GNU/Linux
root@localhost:~# df
Файловая система                       1K-блоков Использовано Доступно Использовано% Cмонтировано в
/dev/block/loop0                          605740       218984   355988           39% /
tmpfs                                     456444            0   456444            0% /mnt/asec
tmpfs                                     456444            0   456444            0% /mnt/obb
/dev/block/bootdevice/by-name/system      543540       486732    45588           92% /system
/dev/block/bootdevice/by-name/userdata   5219784      3038076  2165324           59% /data
/dev/block/bootdevice/by-name/cache       333272          348   326044            1% /cache
/dev/fuse                                5219784      3038076  2165324           59% /mnt/sdcard
/dev/fuse                                7863280       615616  7247664            8% /storage/sdcard1
tmpfs                                     464444            0   464444            0% /tmp

root@localhost:/# ls -lah
итого 120K
drwxr-xr-x.  31 root root 4,0K дек 10 10:46 .
drwxr-xr-x.  31 root root 4,0K дек 10 10:46 ..
drwxr-xr-x.   3 root root    0 янв  2  1970 acct
drwx——.   2 root root 4,0K дек 10 10:41 app-cache
drwxrwxr-x.   2 root root 4,0K дек 10 10:45 bin
drwxr-xr-x.   2 root root 4,0K авг 30 22:32 boot
drwxrwx—.   5 1000 2001 4,0K дек 10 10:42 cache
lrwxrwxrwx.   1 root root   17 дек 10 10:45 d -> /sys/kernel/debug
drwxrwx—x.  35 1000 1000 4,0K дек 10 10:41 data
drwx——.   2 root root 4,0K дек 10 10:41 dbdata
lrwxrwxrwx.   1 root root   12 дек 10 10:45 debian -> /data/debian
drwxr-xr-x.   5 root root 4,0K дек 10 10:44 dev
drwx——.   2 root root 4,0K дек 10 10:41 efs
drwxr-xr-x.  44 root root 4,0K дек 10 10:48 etc
drwxr-xr-x.   2 root root 4,0K авг 30 22:32 home
drwxr-xr-x.   9 root root 4,0K дек 10 10:45 lib
drwxr-xr-x.   2 root root  16K дек 10 10:41 lost+found
drwx——.   2 root root 4,0K дек 10 10:41 media
drwx——.   9 root root 4,0K дек 10 10:41 mnt
drwxr-xr-x.   2 root root 4,0K дек 10 10:45 opt
drwx——.   2 root root 4,0K дек 10 10:41 pds
dr-xr-xr-x. 306 root root    0 янв  1  1970 proc
drwx——.   2 root root 4,0K дек 10 10:45 root
drwxr-xr-x.   4 root root 4,0K дек 10 10:48 run
drwxr-xr-x.   2 root root 4,0K дек 10 10:48 sbin
lrwxrwxrwx.   1 root root   16 дек 10 10:45 sdcard -> /storage/sdcard0
lrwxrwxrwx.   1 root root   53 дек 10 10:46 shell -> /data/data/info.guardianproject.lildebi/app_bin/shell
drwx——.   2 root root 4,0K дек 10 10:41 sqlite_stmt_journals
drwxr-xr-x.   2 root root 4,0K дек 10 10:45 srv
drwx——.   7 root root 4,0K дек 10 10:41 storage
dr-xr-xr-x.  14 root root    0 янв  2  1970 sys
drwxr-xr-x.  17 root root 4,0K дек  7 07:25 system
drwxrwxrwt.   2 root root   40 дек 10 11:01 tmp
lrwxrwxrwx.   1 root root   16 дек 10 10:45 tombstones -> /data/tombstones
drwxr-xr-x.  10 root root 4,0K дек 10 10:45 usr
drwxr-xr-x.  11 root root 4,0K дек 10 10:45 var
lrwxrwxrwx.   1 root root   14 дек 10 10:45 vendor -> /system/vendor

 

NB

(ПАМЯТЬ УСТРОЙСТВА = /data/media/0/ =       sdcard -> /storage/sdcard0)

root@Alto45:/ # ls -al /storage/emulated/
lrwxrwxrwx root     root              1970-01-02 16:05 0 -> /storage/emulated/legacy
drwxrwx—x root     sdcard_r          2015-12-10 15:17 legacy

LINKS

https://github.com/guardianproject/lildebi/wiki

Рубрика: кпк, linux | Оставить комментарий

mac os x pf port redirect

echo «rdr pass on en1 inet proto tcp from any to any port 80 -> 127.0.0.1 port 8888

rdr pass on en1 inet proto tcp from any to any port 443 -> 127.0.0.1 port 8888

» | sudo pfctl -ef —

view

$sudo pfctl -s nat

flush

$sudo pfctl -F all -f /etc/pf.conf

 

Рубрика: admin | Оставить комментарий

apache vhost, iptables open 80 port at defined interface

PRE eth0 — externail iface, eth1 — internal one

TODO allow connect to web-server form internal network

NB iptables -L -v (get rules with interfaces)

Open http port (insert rules above than deny rule) and  close only from outside

iptables -I INPUT 2 -i eth1 -m state —state NEW -p tcp —dport 80 -j ACCEPT  // (optional rule)

iptables —insert INPUT 3 -i eth0  -p tcp —dport 80 -j DROP  // (requare rule)

RESULT (something like this)

#iptables -L -v
Chain INPUT (policy DROP 74616 packets, 6192K bytes)
pkts bytes target prot opt in out source destination
9972K 5487M ACCEPT all — any any anywhere anywhere state RELATED,ESTABLISHED
350K 21M ACCEPT all — lo any anywhere anywhere
64 3232 DROP tcp — eth0 any anywhere anywhere tcp dpt:http
152 8432 ACCEPT tcp — eth0 any anywhere anywhere multiport dports smtp,pop3
411K 24M ACCEPT all — eth1 any anywhere anywhere

Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
9128 1316K ACCEPT all — eth1 eth0 anywhere anywhere state NEW,RELATED,ESTABLISHED

Chain OUTPUT (policy ACCEPT 5803K packets, 3094M bytes)
pkts bytes target prot opt in out source destination
5443K 2562M ACCEPT all — any lo anywhere anywhere

NB Optioanly save-resore rules

iptables-save > /etc/iptables.rules

iptables-restore < /etc/iptables.rules

2) Configure virtual hosts

nano httpd.conf

….
<VirtualHost *:80>
ServerAdmin webmaster@example.com
DocumentRoot /var/www/html/host1.com
ServerName lw.host1.com
ServerAlias http://www.host1.com
ErrorLog /var/www/html/host1.com/error.log
CustomLog /var/www/html/host1.com/custom_log.log common
</VirtualHost>

….

apachectl restart

LINKS

http://wiki.centos.org/HowTos/Network/IPTables

http://www.cyberciti.biz/tips/linux-iptables-11-how-to-block-or-open-httpweb-service.html

https://snipt.net/johan_adriaans/insert-an-iptables-rule-on-a-specific-line-number-with-a-comment-and-restore-all-rules-after-reboot/

http://httpd.apache.org/docs/2.2/vhosts/

Рубрика: Uncategorized | Оставить комментарий