You can encode and decode QR code in command line by using ZXing.
Download jar file of zxing
http://repo1.maven.org/maven2/com/google/zxing/core/3.1.0/core-3.1.0.jar
http://repo1.maven.org/maven2/com/google/zxing/javase/3.1.0/javase-3.1.0.jar
Decoder QR code with an image file (img.png)
java -cp "core-3.1.0.jar:javase-3.1.0.jar" com.google.zxing.client.j2se.CommandLineRunner img.png
Encode QR code
java -cp "core-3.1.0.jar;javase-3.1.0.jar" com.google.zxing.client.j2se.CommandLineEncoder --image_format=GIF --output=output.gif "YHChien: Text for encode here"
Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts
Thursday, August 28, 2014
Monday, July 30, 2012
Windows and Linux Spoof MAC Address
Linux
ifconfig eth0 hw ether 00:11:22:33:44:55
Windows
Registry
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0008]
"NetworkAddress"="001122334455"
or GUI
Start/Settings/Network Connections/Local Area Connection
Properties/Configure ...
Advanced

Advanced (Another example)

ifconfig eth0 hw ether 00:11:22:33:44:55
Windows
Registry
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0008]
"NetworkAddress"="001122334455"
or GUI
Start/Settings/Network Connections/Local Area Connection
Properties/Configure ...
Advanced
Advanced (Another example)
Thursday, June 7, 2012
OpenVPN
Server (IP
1.2.3.4, VPN Subnet 10.8.0.0 / 255.255.255.0)
Install OpenVPN
yum install openvpn
Generate Certificates (by using easy-rsa)
cd
/usr/share/openvpn/easy-rsa/2.0/
#Setup parameters for certificate key generation
vi vars
source ./vars
#Clean all generated certificates and keys
./clean-all
#Generate server certificate
./build-ca
#Generate server key
./build-key-sever server
#Generate client key
./build-key client1
#Generate Diffie Hellman parameters
./build-dh
#Copy keys and certificates to openvpn conf folder (*crt: certificates;
*key: private keys)
cd keys
cp -a ca.crt server.crt server.key dh1024.pem /etc/openvpn/
cp -a ca.crt server.crt server.key dh1024.pem /etc/openvpn/
Create configuration
#copy sampel conf file to openvpn
conf folder
cp -a /usr/share/doc/openvpn-x.x.x/sample-config-files/server.conf
/etc/openvpn/
#Edit conf file
vi /etc/openvpn/server.conf
#Server IP
local 1.2.3.4
#Listen port
port 1194
#protocol tcp or udp (default)
proto tcp
#tunnel tun (default) or tap
dev tun
#SSL/TLS Certificate
ca ca.crt
#Certificate
cert server.crt
#Private key
key server.key
#Diffie hellman
dh dh1024.pem
#VPN subnet, comment out for
bridge mode
server 10.8.0.0 255.255.255.0
#Persistent assignment and log
filename
ifconfig-pool-persist ipp.txt
#bridge mode(10.8.0.4/255.25.255.0:
ip and nm of bridge interface; ip pool 10.8.0.50 ~ 10.8.0.100)
;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100
#DHCP-proxy (use Server-side DHCP
server to assign client IP)
;server-bridge
#enable compression
comp-lzo
#Maximum number of concurrently
connected clients
;max-clients 100
#Server status
status openvpn-status.log
#Log
log-append
#verbosity
verb 3
#Start OpenVPN Service
service openvpn@server.service
Client
#Download ca.crt, client.crt, client.key from Server
cp -a ca.crt client1.crt client.key MyClient
#Copy sample client conf to folder
cp -a /usr/share/doc/openvpn-x.x.x/sample-config-files/client.conf MyClient
#Modify client conf (Linux) / ovpn file (windows)
#
vi client.conf
dev tun
proto tcp
remote 1.2.3.4 1194
ca ca.crt
cert client1.crt
key client1.key
#Execute client with .conf file
openvpn xxx.conf
#Execute client with .ovpn file
<Right-click ovpn file and
select “Start OpenVPN on this config file” in Windows>
Sunday, March 18, 2012
Windows Automatic Login
Run the following command
control userpasswords2
Uncheck "Users must enter a user name and password to use this computer."
Click OK and follow the dialog !
Subscribe to:
Posts (Atom)