quinta-feira, fevereiro 28, 2013

Huawei E173s

USB_ModeSwitch • View topic - Huawei E3231 - new model

Command to make it appears as /dev/ttyUSB0


So according to that comment we should consider this (and probably also the 2 endpoint variants) as "vendor-specific modem interfaces". I wonder if you get any ttyUSBx port responding to AT commands if you do:
Code:
modprobe option
echo 12d1 1c05  >/sys/bus/usb-serial/drivers/option1/new_id

Some minicom commands that can help you changing the settings of the modem

minicom -s (configure, change here the option "Serial port setup" -> "A -    Serial Device      :" to /dev/ttyUSB0

exit

type in your commands
example: AT^U2DIAG?
example2: AT^U2DIAG=276

Commands supported

Huawei AT-commandsThis is a featured page

note: Some devices like the Huawei K3715 seem to require AT-commands to be typed in capital letters!

There are a couple of options for disabling and re-enabling the following USB-components of Huawei USB-modems:

  • modem (M)
  • NAND-flashmemory drive (CD)
  • microSD-drive (SD)
  • PC UI interface (UI)
  • network adaptor (N)
  • smartcard (SC)
To disable or re-enable those components run the following AT-command, where n is one of the numbers from the table below:

AT^U2DIAG=n

On some models it is possible to read the present value of the parameter n by sending command:
AT^U2DIAG?

nMCDSDUINSCremarkssupported bynot supported by
0+

+


E160, E1750
1++






3+

+
+won't work on devices without SC*

5
+
++
won't work on devices without N*

9
+

++won't work on devices without N & SC*

10++


+won't work on devices without SC*

12
+
++
won't work on devices without N*

255++++??reset to factory defaultsE160, E160E, K3565, K3715E176, E1762, E1750, E173
256+
++

for most devices: everything enabled except the flashmemory; microSD-drive will be available under Windows even without drivers installedE160, E160E, E173, E1750, E1762, K3565, K3715E176
257+++





259+
++
+won't work on devices without SC*E173u-2, E176
261
++
++won't work on devices without N & SC*

265
++
++won't work on devices without N & SC*

266+++

+won't work on devices without SC*

267
++
+
won't work on devices without N*

268++++

won't work on devices without N*E1750, K3565, E173
276+++++?reset to factory defaultsE1762, K3565, K3765, E173, E1750

*) note: Smartcard (SC) and network adaptor (N) are not present in many Huawei devices. Using an AT-command that activates SC or N on a device without these components, will result in errors and so will be noneffective.


Modems supporting AT^U2DIAG? command: E173, E1750 ,E160E
 Modems not supporting AT^U2DIAG? command: E160, K3565

Also on some models it is possible to display a list of devices present in a USB-stick, by sending a command:
AT^GETPORTMODE

alex's coding playground » USB Image Tool

alex's coding playground » USB Image Tool

USB Image Tool


Overview

USB Image Tool can create images of USB flash drives and MP3 players, that are mounted as USB drives. It allows you switch between images with different music styles on your MP3 Player or to make an exact backup image of your USB Stick.

Features
create image files of USB flash drives
restore images of USB flash drives
compressed image file format
show USB device information
manage favorite USB images
command line utility

ISO Image to usb

terça-feira, fevereiro 26, 2013

Why can't I access forwarded ports on my WAN IP from my LAN/OPTx networks? - PFSenseDocs

Why can't I access forwarded ports on my WAN IP from my LAN/OPTx networks? - PFSenseDocs

y default, pfSense does not allow LAN/OPTx connected PCs to reach forwarded ports on the WAN interface. This is a technical limitation of how the underlying PF functions, it cannot "reflect" in and out the same Interface; it only works when passing "through" the router. NAT Reflection employs some simple bouncing daemons to redirect the connections, which works but isn't always desirable, or even functional for some scenarios. Usually, split DNS is the better way if it is possible on your network. Both are explained here.

Method 1: NAT Reflection

In order to access ports forwarded on your WAN interface from internal networks, you need to enable NAT reflection.
In order to do this, you must go to System > Advanced, and from there uncheck "Disable NAT Reflection". Click save, and it should work. This will only work with single port forwards or ranges of less than 500 ports. If you're using 1:1 NAT, you can only use NAT Reflection with version 2.0 and newer.
Example of system with NAT Reflection enabled. (Disable choice is unchecked).

Method 2: Split DNS

The more elegant solution to this problem involves using Split DNS. Basically this means that internal and external clients resolve your hostnames differently.
Your internal clients would access your resources by hostname, not IP, and clients on your local network would resolve that hostname to your LAN IP, and not the WAN IP as others outside your network would see.
In order for this to work using the DNS forwarder in pfSense, your clients will need to have the IP Address of the pfSense router as their primary DNS server.
Example:
  • www.example.com resolves to public IP 1.2.3.4, which is your WAN IP
  • You forward port 80 on 1.2.3.4 to port 80 on 192.168.1.5
  • You override www.example.com using System > DNS Forwarder and point www.example.com to 192.168.1.5
    • You could also override this with some other internal DNS mechanism.
Some screenshots that show the above in practice:
Split DNS Example, adding DNS Override
Split DNS Example, what your screen should look like with www.example.com overridden as 192.168.1.5

Method 3: Experimental Routing Tricks

This should be considered experimental, and could possibly cause bad things to happen!
If you're using 1:1 NAT, you can't use NAT Reflection. If you're a service provider (a web host, say), you may not have all relevant DNS entries under your control, so "Method 2: Split DNS" may be difficult to implement.
If you have a CIDR network block allocated to you which is all behind your pfSense firewall, you might be better off using public addresses on your internal network, or using a mix of public and private addresses.
If you have only a portion of your CIDR block behind pfSense, and you're using 1:1 NAT, you may have a difficult situation. Here's a possible approach you can consider. This may not work, or may work in only some situations. Be careful: don't try this if you're remote or don't have console access to your devices.
1. Make the external IP address an alias on your loopback interface (the interface with localhost/127.0.0.1 on it). In FreeBSD, that's something like this on the command line:
ifconfig lo0 inet 1.2.3.4 netmask 255.255.255.255 alias
2. Cause every other internal host to route traffic destined to your external IP to your internal IP. There may be 3 ways to do this:
a) Add a static route on every other host with something like route add -host 1.2.3.4 10.0.0.4 but you have to run that on every other host. This option can quickly become administratively difficult as the number of internal hosts goes up, but this can be mitigated if you have centralized administration (via something like cfagent, say).
b) Run a routing protocol - routed for example - on your internal network, and publish routes reflecting the external/internal 1:1 NAT mapping. This might be the most complicated choice, but might scale better than the other alternatives.
c) This seems to not work, presumably because pfSense already knows a route to the external network: Add static routes on the LAN interface of your pfSense firewall with a destination of the external address (1.2.3.4/32) and a gateway of the internal address (10.0.0.4/32). This alternative worries me a little bit, as I'm afraid it might confuse the firewall - I don't think so, but please be careful.

domingo, fevereiro 24, 2013

Change apn settings on iphone or android


http://wiki.apnchanger.org/Main_Page

Getting started
To change APN settings on iPhone or iPad, go from iPhone/iPad Safari browser to m.apnchanger.org
To change APN settings on Android smartphones, MiFi data modems or other mobile devices go to specific country and cellular provider. Install it manually on your device (devices can be found in "Mobile Devices APN guide" section below)
To see specific Cellular Carrier settings or prepaid data plans, choose country and operator

sábado, fevereiro 16, 2013

Nexus 4 Stock OTA URLs



[REF] Nexus 4 Stock OTA URLs

Below are a list of all known Nexus 4 OTA updates. Each time there is a new OTA update, the links will be posted here as they become available. If you get an OTA notification that we don't have a link for, please pull the filename out of logcat for us before applying the OTA and post it here. Once you post it, I'll update this post and mirror the file on my website,http://randomphantasmagoria.com, in case Google pulls it down in the future.

sexta-feira, fevereiro 15, 2013

[Guide] Ultimate Nexus 4 Root Guide - xda-developers

[Guide] Ultimate Nexus 4 Root Guide - xda-developers

---
Another good source to make your nexus 4 rooted
--
[Guide] Ultimate Nexus 4 Root Guide

Post One: Unlocking and Rooting
Post Two: Installing Roms / Kernels / Tweaks
Post Three: Panic Section / FAQ / Miscellaneous


Unlocking The Bootloader And Obtaining Root
*This part of the tutorial is geared towards Windows users. The MAC instructions are very similar, from what I understand. Install the package the same way. All ADB/Fastboot commands may need to start with "adb-mac" (no quotes) rather than "adb" (no quotes). Due to the vast amount of Linux distros available; instructions will vary for your device. Once ADB/Fastboot are set up all command will begin with "./adb" (no quotes) rather than "adb" (no quotes). Once ADB/Fastboot are set up; this guide is relevant to everyone.*

Time required:
20-40 minutes.

Setting up ADB for our device:
Download the AndroidSDK onto your computer.
Note: Google changes their mind every other week as to if this will be distributed as a .zip or an .exe. If you get an .zip file, simply extract the contents to your C:\ drive. For an .exe install it like you would any other program, but set the path directly to the C:\ drive when the installer asks.

Or...you can use this page to download the "ADB for Dummies AIO App."
This will automatically install ADB for you to your C:\ directory. It's very very simple this way.

If your platform-tools folder doesn't have a fastboot.exe, place this fastboot.exe file in your C:\android-sdk-windows\platform-tools (or possibly simply called tools, if you set up ADB ages ago) folder.

Now you have ADB installed! Congratulations.

Unlocking the Bootloader:
***NOTE***
This may perform a factory reset on your device. You might lose all applications. Even the data on your SD Card! I'd recommend making a Backup to your computer BEFORE performing this. There is a method for backing your data up, detailed HERE.

Get the drivers:
Uninstall any previously attempted drivers if they don't work and move to the next.
Option One: Steps 16-27.
Option Two: Try this one as well. Use CyanogenMod's Guide for installing ADB - Steps 16 through 27 replacing the file/location with the naked drivers.
PDAnet's drivers may work if the above options don't. Simply install PDAnet (after uninstalling any previous attempted driver installations) to get the drivers.
WINDOWS 8 TIP
Q. I have Windows 8 and cannot install the drivers

How to Disable Driver Signature Enforcement in Windows 8:

From the Metro Start Screen, open Settings (move your mouse to the bottom-right-corner of the screen and wait for the pop-out bar to appear, then click the Gear icon).
Click ‘More PC Settings’.
Click ‘General’.
Scroll down, and click ‘Restart now’ under ‘Advanced startup’.
Wait a bit.
Click ‘Troubleshoot’.
Click ‘Advanced Options’
Click ‘Windows Startup Settings’
Click Restart.

When your computer restarts, select ‘Disable driver signature enforcement‘ from the list. You can now load your modified driver. Reboot again once the driver is installed and all will be well.


----

While that is downloading, on your Nexus 4: turn USB debugging on.
To do so; you must first go to Settings>About>Build Number and click seven times.
The actual setting can then be found in Settings>Developer Options>USB Debugging
Once the drivers are installed, navigate to the C:\android-sdk-windows\platform-tools folder on your computer.
Hold shift and right click. Select "Open Command Window Here."
Plug your phone into the computer. Now in this command window type:
Code:
adb reboot bootloader
(Hit Enter)
Your phone should now boot into a screen with a green android with his chest exposed.
Type this:
Code:
fastboot oem unlock
(Hit Enter)
If your Command Prompt displays the message "waiting for device" your driver wasn't successfully installed.
Close the Command Prompt window and open Device manager while your phone is still plugged in. (Search for it using the search option).

Right Click the "Android" option and select Update Driver. Choose to "Browse My Computer" and "Let Me Pick From A List." Pick the Driver with the newest date and install it. Now retry the code above.
Your phone will ask if you want to unlock it. Select "Yes" by using the volume keys and use power to select it.
Now, navigate to "Recovery Mode" with the volume keys. Use power to select.
A screen with another Android will pop up. Press Volume Up and Power at the same time.
Select Factory Reset. This process may take a few minutes. Be patient and let it work.
Once finished, select "Reboot."
Your phone is now unlocked!

Obtaining Root Access and Custom Recovery:
Turn on USB Debugging.
To do so; you must first go to Settings>About>Build Number and click seven times.
The actual setting can then be found in Settings>Developer Options>USB Debugging
Download the following:
SuperSU (CWM .zip)
CWM (Pick the version for your device)

Place the recovery-clockwork-VERSIONNUMBER-mako.img file into your C:\android-sdk-windows\platform-tools folder.
Put the SuperSU.zip on your phone.
Open another Command Prompt if it isn't still open. (Navigate to C:\android-sdk-windows\platform-tools and shift + right click. Select "Open Command Window Here.")
With your phone plugged in type:
Code:
adb reboot bootloader
(Hit Enter)
And wait for your phone to boot into the android again.

Now type:
Code:
fastboot flash recovery [(CMW Downloaded above)].img
(Change the file name to the correct file name and Hit Enter)

Once that is finished: select the "Recovery Mode" option again on your phone.
You should get a new recovery menu here. Select "install zip from sd card" and "choose zip from sd card."
Find the SuperSU.zip that you transferred earlier and select "Yes" to installing.
Navigate back to "Reboot" and reboot your phone.
You're now rooted!
However, ClockworkMod Recovery won't continue to load after this.
To fix this, find "Rom Manager" from the market. (The free version is fine.) Use the "Flash ClockworkMod Recovery" option.
If your recovery still doesn't stick around after a reboot, you have another couple options. Find a file explorer that allows root access, such asRoot Explorer. Use this program to rename /system/etc/install-recovery.sh to /system/etc/install-recovery.bak. You'll need to mount the system as r/w to do this. Root Explorer provides a button at the top to do so.
Or, you can do this completely manually by firing up ADB again and running a few commands:


Code:
adb shell
(Hit Enter)
Code:
su
(Hit Enter)
Code:
mount -o remount,rw -t ext4 /dev/block/mmcblk0p1 /system
(Hit Enter)
Code:
mv /system/etc/install-recovery.sh /system/etc/install-recovery.bak
(Hit Enter)

Congratulations!
Your phone is now unlocked, rooted, and has a custom recovery!
Continue reading the next posts for info on getting custom roms, kernels, tweaks, and more!

***I take no responsibility for what happens to your phone due to following this guide! That being said, not only am I sure you'll be fine...but there are an endless amount of users who would be glad to help if you need it.***

Thanks:
Google, for making Android a reality.
VanillaTbone, for the ADB AIO app.

Efrant, for posting about a bootloader locking utility without USB.
ClockworkMod team, for being a part of making our phones as awesome as they are.
The assorted developers, who continue to push out amazing material for us to use.
The awesome community, for endlessly supporting both Android itself and its users.

Squid transparant load balance how-to

Squid transparant load balance how-to
pfsense make squid use gateway group


Hi,

For the last couple of weeks/months i've been trying to get squid to loadbalance/failover using gateway-groups. (in vmware)

Currently i'm at the point that i'm able to get it working with VERY BAD PERFORMANCE. 
I believe some minor tweaks are still needed but i'll publish what i have so far and hope someone will figure out how to get it right.

my wan ip: 192.168.5.2 (gw=192.168.5.1)
my opt1 ip: 10.168.20.2 (gw=10.168.20.1)
my lan ip: 10.10.20.1 (gw=gateway-group)


1. install latest snapshot & configure your interfaces (i'm using the 2011/01/20 snapshot)

2. in system-->routing add gateways for all interfaces
    in the group tab add a loadbalancing group (tier 1 , all interfaces)


3. make sure to add the gateways to the WAN/OPT interface (interface menu)

4. Firewall rules:




details about the floating rule see this pdf: http://goput.it/fer.pdf
or bellow







note the state-type !!! <-- bad="" but="" causes="" doesn="" i="" it="" m="" performance="" pretty="" span="" sure="" t="" the="" this="" without="" work="">
also: don't forget the gateway-group

5. Nat rules:


6. Install squid (system-->packages-->squid)

7. Configure squid bellow
http://goput.it/hhe.pdf
note the 'tcp_outgoing_address' directive at the bottom.





I hope some people will find this useful and perhaps come up with a solution for the performance issue.
my complete config can be downloaded here:  http://goput.it/hah.xml