Channel Frequency(MHz)
1 2412
2 2417
3 2422
4 2427
5 2432
6 2437
7 2442
8 2447
9 2452
10 2457
11 2462
12 2467
13 2472
14 2484
36 5180
40 5200
44 5220
48 5240
52 5260
56 5280
60 5300
64 5320
100 5500
104 5520
108 5540
112 5560
116 5580
120 5600
124 5620
128 5640
132 5660
136 5680
140 5700
149 5745
153 5765
157 5785
161 5805
165 5825
January 30, 2015
January 27, 2015
Turn your PHP project to a standalone Windows application
Free and Open source ones:
1. PHP Desktop (I tried it and it works really well)
https://code.google.com/p/phpdesktop/
2. http://sourceforge.net/projects/wapache/
3. https://github.com/naetech/nightrain
Paid ones:
http://www.zzee.com/phpexe/
1. PHP Desktop (I tried it and it works really well)
https://code.google.com/p/phpdesktop/
2. http://sourceforge.net/projects/wapache/
3. https://github.com/naetech/nightrain
Paid ones:
http://www.zzee.com/phpexe/
December 18, 2014
Install a minimal X on Linux
apt-get install xinit i3 rxvt
i3 is the lightweight window manager
rxvt is the terminal
xinit gives you X windows and the famous "startx" command
To make i3 use your full screen resolution, create the file ~/.xinitrc and put the following there
xrandr --output Virtual1 --mode 1680x1050
exec i3
i3 is the lightweight window manager
rxvt is the terminal
xinit gives you X windows and the famous "startx" command
To make i3 use your full screen resolution, create the file ~/.xinitrc and put the following there
xrandr --output Virtual1 --mode 1680x1050
exec i3
You may need to change the name "Virtual1" to something else. Use xrandr to list all the known windows (you first need to have X windows running though)
December 12, 2014
December 9, 2014
p11tool, gnutls and PIV CAC card
p11tool --list-all-certs
p11tool --login --export "pkcs11:model=PKCS%2315%20emulated;manufacturer=piv_II;serial=36889385781093f6;token=PIV_II%20%28PIV%20Card%20Holder%20pin%29;id=%02;object=Certificate%20for%20Digital%20Signature;object-type=cert" > /tmp/02.cert
p11tool --list-all-privkeys --login
x509 certificate subject name and OID
In a X509 certificate, there is always a subject name like the following:
$ openssl x509 -in user-cert.pem -text -noout
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 1373122324 (0x51d82f14)
Signature Algorithm: sha256WithRSAEncryption
Issuer: CN=CA
Validity
Not Before: Jul 6 14:52:05 2013 GMT
Not After : May 15 14:52:05 2023 GMT
Subject: UID=test,CN=A user
$ openssl x509 -in user-cert.pem -text -noout
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 1373122324 (0x51d82f14)
Signature Algorithm: sha256WithRSAEncryption
Issuer: CN=CA
Validity
Not Before: Jul 6 14:52:05 2013 GMT
Not After : May 15 14:52:05 2023 GMT
Subject: UID=test,CN=A user
Inside the subject line, there can be multiple subparts, such as CN=xxx, DC=xxxx, UID=xxx, OU=xxx, C=xxx, ... Each subpart is represented in the certificate as an OID that is globally unique and registred with IETF. For example, the OID of CN is 2.5.4.3, and the OID of UID is 0.9.2342.19200300.100.1.1. How are we supposed to find out the OID? Openssl provides a command option for just.
openssl x509 -in user-cert.pem -text -noout -nameopt RFC2253,oid
This command will print out the cert with the OID=xxx instead of CN=xxx.
December 8, 2014
cross compile openconnect
Openconnect is a nice open source SSL VPN client for Cisco AnyConnect, and also for the open source SSL vpn server ocserv (hosted on the same website as openconnect). Below are some tips on how to cross compile openconnect for ARM, with GnuTLS
Openconnect works with both Openssl and GnuTLS. However, to use hardware token (smart card, etc), you will need GnuTLS.
Dependencies:
Openconnect depends on GnuTLS (3.3.9)
GnuTLS depends on libnettle, and libhogweed 2.7.1 (both in the nettle package)
libnettle depends on gnu GMP (libgmp, version 6.0.0)
To use hardware token, GnuTLS also depends on p11-kit (version 0.22.1) and pcsc-lite (version 1.8.11), and opensc (0.14.0), which depends on pcsc-lite.
All of these packages support autoconfig so that one can run "configure" to generate the makefile(s). We use the --prefix "/opt/ncs-install" to install all packages. Below are the customized "configure" scripts for each package:
p11-kit-0.22.1:
CC=arm-none-linux-gnueabi-gcc CXX=arm-none-linux-gnueabi-g++ ./configure --host=arm-linux --prefix=/opt/ncs-install \
--without-libffi --without-libtasn1
gmp-6.0.0:
CC=arm-none-linux-gnueabi-gcc CXX=arm-none-linux-gnueabi-g++ ./configure --host=arm-linux --prefix=/opt/ncs-install
Openconnect works with both Openssl and GnuTLS. However, to use hardware token (smart card, etc), you will need GnuTLS.
Dependencies:
Openconnect depends on GnuTLS (3.3.9)
GnuTLS depends on libnettle, and libhogweed 2.7.1 (both in the nettle package)
libnettle depends on gnu GMP (libgmp, version 6.0.0)
To use hardware token, GnuTLS also depends on p11-kit (version 0.22.1) and pcsc-lite (version 1.8.11), and opensc (0.14.0), which depends on pcsc-lite.
All of these packages support autoconfig so that one can run "configure" to generate the makefile(s). We use the --prefix "/opt/ncs-install" to install all packages. Below are the customized "configure" scripts for each package:
p11-kit-0.22.1:
CC=arm-none-linux-gnueabi-gcc CXX=arm-none-linux-gnueabi-g++ ./configure --host=arm-linux --prefix=/opt/ncs-install \
--without-libffi --without-libtasn1
CC=arm-none-linux-gnueabi-gcc CXX=arm-none-linux-gnueabi-g++ ./configure --host=arm-linux --prefix=/opt/ncs-install
nettle-2.7.1:
CFLAGS=-I/opt/ncs-install/include LDFLAGS=-L/opt/ncs-install/lib CC=arm-none-linux-gnueabi-gcc CXX=arm-none-linux-gnueabi-g++ ./configure --host=arm-linux --prefix=/opt/ncs-install
pcsc-lite-1.8.11:
CFLAGS="-I/opt/ezsdk/linux-devkit/arm-none-linux-gnueabi/usr/include/"
CC=arm-none-linux-gnueabi-gcc ./configure -host=arm-linux --disable-libudev --enable-libusb \
LIBUSB_CFLAGS="-I/opt/ezsdk/linux-devkit/arm-none-linux-gnueabi/usr/include/libusb-1.0/ -L/opt/ezsdk/linux-devkit/arm-none-linux-gnueabi/usr/lib" \
LIBUSB_LIBS="-lusb-1.0"
/opensc-0.14.0:
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export LTLIB_LIBS="-L/opt/ezsdk/linux-devkit/arm-none-linux-gnueabi/usr/lib/ -lltdl"
export PCSC_CFLAGS="-I$DIR/../pcsc-lite-1.8.11/src/PCSC"
export LIBTOOL_SYSROOT_PATH=/opt/ezsdk/linux-devkit/arm-none-linux-gnueabi/
export CFLAGS="-I/opt/ezsdk/linux-devkit/arm-none-linux-gnueabi/usr/include -L/opt/ezsdk/linux-devkit/arm-none-linux-gnueabi/usr/lib"
export LDFLAGS="-lcrypto"
export CC=arm-none-linux-gnueabi-gcc
./configure -host=arm-linux -v
gnutls-3.3.9:
CFLAGS=-I/opt/ncs-install/include LDFLAGS=-L/opt/ncs-install/lib \
ZLIB_CFLAGS=-I/opt/ezsdk/linux-devkit/arm-none-linux-gnueabi/usr/include/ \
ZLIB_LIBS="-L/opt/ezsdk/linux-devkit/arm-none-linux-gnueabi/usr/lib -lz" \
CC=arm-none-linux-gnueabi-gcc CXX=arm-none-linux-gnueabi-g++ ./configure --host=arm-linux --prefix=/opt/ncs-install \
--with-nettle-mini --disable-crywrap \
--with-p11-kit \
--with-default-trust-store-file=/etc/ssl/certs/ca-certificates.crt
openconnect-7.00:
LIBPCSCLITE_CFLAGS=-I/opt/ncs-install/include/PCSC/ \
LIBPCSCLITE_LIBS="-L/opt/ncs-install/lib -lpcsclite" \
LIBXML2_CFLAGS=-I/opt/ezsdk/linux-devkit/arm-none-linux-gnueabi/usr/include/libxml2/ \
LIBXML2_LIBS="-L/opt/ezsdk/linux-devkit/arm-none-linux-gnueabi/usr/lib -lxml2" \
CFLAGS=-I/opt/ncs-install/include LDFLAGS=-L/opt/ncs-install/lib \
LDFLAGS="-L/opt/ncs-install/lib -lp11-kit -lnettle -lhogweed -lgmp" \
ZLIB_CFLAGS=-I/opt/ezsdk/linux-devkit/arm-none-linux-gnueabi/usr/include/ \
ZLIB_LIBS="-L/opt/ezsdk/linux-devkit/arm-none-linux-gnueabi/usr/lib -lz" \
CC=arm-none-linux-gnueabi-gcc ./configure --prefix=/opt/install --disable-nls --host=arm-linux --without-openssl --with-gnutls
December 4, 2014
how to verify certificate signed by intermediate CA
openssl verify -untrusted intermediate-ca.pem your-cert.pem
Put the list of intermediate CA (in PEM format, concatenated ) in intermediate-ca.pem, and use the "-untrusted" option. That name tricked me initially, and that's the one to use.
The above command is to use the system CA list to verify the cert. If you have your own CA, just use the option "-CAfile your-ca.pem".
Put the list of intermediate CA (in PEM format, concatenated ) in intermediate-ca.pem, and use the "-untrusted" option. That name tricked me initially, and that's the one to use.
The above command is to use the system CA list to verify the cert. If you have your own CA, just use the option "-CAfile your-ca.pem".
November 25, 2014
How to make IE not cache your golang web app responses
var w http.ResponseWriter
w.Header().Set("cache-control", "priviate, max-age=0, no-cache")
w.Header().Set("pragma", "no-cache")
w.Header().Set("expires", "-1")
w.Header().Set("cache-control", "priviate, max-age=0, no-cache")
w.Header().Set("pragma", "no-cache")
w.Header().Set("expires", "-1")
November 24, 2014
Clear windows event log
Run this following line in PowerShell as Admin:
wevtutil el | Foreach-Object {Write-Host "Clearing $_"; wevtutil cl "$_"}
November 19, 2014
Read godoc in vim using Shift K
Add the following to your ~/.vim/ftplugin/go.vim (the key here is to use <cfile> not <cword>)
fun! ReadMan()
" Assign current file under cursor to a script variable:
let s:man_word = expand('<cfile>')
:exe ":Godoc " . s:man_word
endfun
" Map the K key to the ReadMan function:
map K :call ReadMan()<CR>
=======UPDATE========
Had a better way for this:
1. Create a file in your ~/bin called godoc.sh with the following content:
#!/bin/sh
fullpkg=`gawk -v "cmd=$1" '
{ FS="/" }
{
if ($NF==cmd || $0 ==cmd){
printf("%s",$0);
exit;
}
}' ~/bin/gopkg-list.txt`
echo -n $fullpkg
fun! ReadMan()
" Assign current file under cursor to a script variable:
let s:man_word = expand('<cfile>')
:exe ":Godoc " . s:man_word
endfun
" Map the K key to the ReadMan function:
map K :call ReadMan()<CR>
=======UPDATE========
Had a better way for this:
1. Create a file in your ~/bin called godoc.sh with the following content:
#!/bin/sh
fullpkg=`gawk -v "cmd=$1" '
{ FS="/" }
{
if ($NF==cmd || $0 ==cmd){
printf("%s",$0);
exit;
}
}' ~/bin/gopkg-list.txt`
echo -n $fullpkg
2. Create a text file in ~/bin/gopkg-list.txt with the following contents:
log/syslog
unicode/utf8
unicode/utf16
testing
hash/crc64
hash/adler32
hash/fnv
hash/crc32
archive/zip
archive/tar
expvar
mime
reflect
crypto/des
crypto/sha1
crypto/subtle
crypto/aes
crypto/md5
crypto/cipher
crypto/rand
crypto/ecdsa
crypto/tls
crypto/sha512
crypto/x509
crypto/sha256
crypto/elliptic
crypto/hmac
crypto/rsa
crypto/x509/pkix
crypto/rc4
crypto/dsa
flag
strings
sync
os/user
os/signal
os/exec
os
fmt
syscall
time
runtime/pprof
runtime/cgo
runtime/debug
runtime/race
net/http/httputil
net/http/cookiejar
net/http/fcgi
net/http/pprof
net/http/cgi
net/http/httptest
net/rpc/jsonrpc
net/mail
net/http
net/textproto
net/url
net/rpc
net/smtp
io/ioutil
math
database/sql/driver
database/sql
mime/multipart
bytes
errors
sort
bufio
encoding
log
path/filepath
index/suffixarray
net
crypto
sync/atomic
go/printer
go/doc
go/scanner
go/ast
go/parser
go/token
go/build
go/format
unicode
image
io
runtime
html/template
regexp
html
container/ring
container/list
container/heap
hash
path
regexp/syntax
text/template/parse
text/tabwriter
text/template
text/scanner
strconv
testing/quick
testing/iotest
compress/flate
compress/zlib
compress/lzw
compress/bzip2
compress/gzip
image/color
image/draw
image/color/palette
image/png
image/gif
image/jpeg
encoding/base64
encoding/base32
encoding/xml
encoding/asn1
encoding/pem
encoding/ascii85
encoding/csv
encoding/hex
encoding/json
encoding/binary
encoding/gob
debug/pe
debug/plan9obj
debug/dwarf
debug/elf
debug/gosym
debug/macho
math/rand
math/big
math/cmplx
3. In your ~/.vim/ftplugin/go.vim, add the following:
fun! ReadMan()
" Assign current file under cursor to a script variable:
let s:man_word = expand('<cword>')
let s:full_word = system('~/bin/godoc.sh '. s:man_word)
:exe ":Godoc " . s:full_word
endfun
" Map the K key to the ReadMan function:
map K :call ReadMan()<CR>
This will take the keyword under cursor, expanded using the shell script, and call :Godoc on it. This takes care of subpackages
November 14, 2014
ios validate self signed certificate
http://stackoverflow.com/questions/10979922/ios-and-ssl-unable-to-validate-self-signed-server-certificate
Quote:
Quote:
|
I did figure out how to resolve this issue.
I ended up comparing the client and server trust certificates, byte-by-byte. Although there could be another way to resolve such issues of self-signed certificate, but for this solution did work. Here is how I'm doing comparison of the client and server certificates, byte-by-byte, using their CFData objects(you can also reference 'AdvancedURLConnections' example code provided by Apple):
Hope this will help someone, who is looking for solution of similar issue, |
November 12, 2014
the ffmpeg command to explode video into still images
ffmpeg.exe -i IMG_0278.MOV -ss 0 -t 1 -f image2 -sameq -vcodec mjpeg "img-%03d.jpg"
-ss: start time, 0 means starting at 0 second mark
-t : number of seconds to explode
November 7, 2014
November 6, 2014
vim and error list
If you have text file that contains the list of errors with line positions, you can tell vim to use that to help you navigate through the list.
1. Edit the list to the following format (suppose it is named "errors.txt")
xxxx.c:123: Warning/Error/Info rest-of-the-text
where
xxxx.c is the source code file name
123 is the line number
2. vim -q errors.txt
3. now you can type ":cw" to open the "quickfix" window which list the errors, and use ":cn" and ":cp" to go through them. Mapping these to a short cut key will make life easier. I map mine to Ctrl-j and Ctrl-k for down and up (copy and the paste the following to your ~/.vimrc file)
map <C-J> :cn<CR>
map <C-K> :cp<CR>
1. Edit the list to the following format (suppose it is named "errors.txt")
xxxx.c:123: Warning/Error/Info rest-of-the-text
where
xxxx.c is the source code file name
123 is the line number
2. vim -q errors.txt
3. now you can type ":cw" to open the "quickfix" window which list the errors, and use ":cn" and ":cp" to go through them. Mapping these to a short cut key will make life easier. I map mine to Ctrl-j and Ctrl-k for down and up (copy and the paste the following to your ~/.vimrc file)
map <C-J> :cn<CR>
map <C-K> :cp<CR>
November 5, 2014
check ip address owner
For an U.S IP address, you can go to the following site:
http://whois.arin.net
and put the IP address in the search box of top right corner, and you can get more info on it.
Once you find the owner, you can click on "Related Networks" to find all the IP addresses that owner owns.
http://whois.arin.net
and put the IP address in the search box of top right corner, and you can get more info on it.
Once you find the owner, you can click on "Related Networks" to find all the IP addresses that owner owns.
November 3, 2014
How to dump Mac OS X dns cache
DNS cache information is not
managed by Directory Services, contrary to popular opinion on this site.
It's managed by mDNSResponder, and the man page contains the answer to
your question:
A SIGINFO signal will dump a snapshot summary of the internal state to /var/log/system.log:
% sudo killall -INFO mDNSResponder
October 31, 2014
Windows Active Directory (AD) LDAP binding account
The common way to bind to AD as an LDAP server is to use "Distinguished Name(DN)" and Password. The DN usually is in the form of: CN=username,CN=Users,DC=yourdomain,DC=com
To find out DN, you can use Sysinternal's Active Directory Explorer to connect to AD and browse to the user to find out.
According to this post on stackoverflow, http://serverfault.com/questions/497368/ldap-activedirectory-binddn-syntax, you can also use UPN, which typically has the value of:
<sAMAccountName>@<domain FQDN>
To find out DN, you can use Sysinternal's Active Directory Explorer to connect to AD and browse to the user to find out.
According to this post on stackoverflow, http://serverfault.com/questions/497368/ldap-activedirectory-binddn-syntax, you can also use UPN, which typically has the value of:
<sAMAccountName>@<domain FQDN>
Subscribe to:
Posts (Atom)
