December 4, 2008

Nokia6630 + Debian Linux

Использование Nokia 6630 в качестве модема на Debian Linux
Создаем три файла:
/etc/ppp/3g
# Most GPRS phones don't reply to LCP echo's
lcp-echo-failure 0
lcp-echo-interval 0
# Keep pppd attached to the terminal:
# Comment this to get daemon mode pppd
nodetach
# Debug info from pppd:
# Comment this off, if you don't need more info
debug
# Show password in debug messages
show-password
# Connect script:
# scripts to initialize the GPRS modem and start the connection,
connect /etc/ppp/3g-connect-chat
# Disconnect script:
# AT commands used to 'hangup' the GPRS connection.
disconnect /etc/ppp/3g-disconnect-chat
# Serial device to which the GPRS phone is connected:
/dev/ttyACM0 # Data cable device file
# Serial port line speed
115200 # fast enough
#57600
# Hardware flow control:
# Use hardware flow control with cable, Bluetooth and USB but not with IrDA.
crtscts # serial cable, Bluetooth and USB, on some occations with IrDA too
#nocrtscts # IrDA
# Ignore carrier detect signal from the modem:
local
# IP addresses:
# - accept peers idea of our local address and set address peer as 10.0.0.1
# (any address would do, since IPCP gives 0.0.0.0 to it)
# - if you use the 10. network at home or something and pppd rejects it,
# change the address to something else
0.0.0.0:0.0.0.0
# pppd must not propose any IP address to the peer!
noipdefault
# Accept peers idea of our local address
ipcp-accept-local
# Add the ppp interface as default route to the IP routing table
defaultroute
# DNS servers from the phone:
# some phones support this, some don't.
usepeerdns
# ppp compression:
# ppp compression may be used between the phone and the pppd, but the
# serial connection is usually not the bottleneck in GPRS, so the
# compression is useless (and with some phones need to disabled before
# the LCP negotiations succeed).
novj
nobsdcomp
novjccomp
nopcomp
noaccomp
noccp
# The phone is not required to authenticate:
noauth
# Username and password:
# If username and password are required by the APN, put here the username
# and put the username-password combination to the secrets file:
# /etc/ppp/pap-secrets for PAP and /etc/ppp/chap-secrets for CHAP
# authentication. See pppd man pages for details.
user "none"
password 123456
#
mtu 1500
mru 1500
asyncmap 0xa0000

/etc/ppp/3g-connect-chat
#!/bin/sh
exec chat \
TIMEOUT 5 \
ECHO ON \
ABORT '\nBUSY\r' \
ABORT '\nERROR\r' \
ABORT '\nNO ANSWER\r' \
ABORT '\nNO CARRIER\r' \
ABORT '\nNO DIALTONE\r' \
ABORT '\nRINGING\r\n\r\nRINGING\r' \
'' AT \
OK ATH \
OK ATE1 \
OK 'AT+CGDCONT=1,"IP","internet.saunalahti","0.0.0.0",0,0' \
OK ATD*99# \
TIMEOUT 22 \
CONNECT ""

/etc/ppp/3g-disconnect-chat
#!/bin/sh
exec /usr/sbin/chat -V -s -S \
ABORT "BUSY" \
ABORT "ERROR" \
ABORT "NO DIALTONE" \
SAY "\nSending break to the modem\n" \
"" "K" "" "K" "" "K" "" \
"+++ATH" "" "+++ATH" "" "+++ATH"

В файле /etc/ppp/peers/3g меняем пути:
connect /etc/ppp/3g-connect-chat меняем на connect /etc/ppp/peers/3g-connect-chat
disconnect /etc/ppp/peers/3g-disconnect-chat меняем на disconnect /etc/ppp/peers/3g-disconnect-chat
Затем в файлах /etc/ppp/peers/3g и /etc/ppp/peers/3g-connect-chat нужно указать параметры своего оператора:
в строке user "none" пишем вместо none имя пользователя для своего оператора
в строке password 123456 пишем вместо 123456 пароль для своего оператора
В файле /etc/ppp/peers/3g-connect-chat
в строке
OK 'AT+CGDCONT=1,"IP","internet.saunalahti","0.0.0.0",0,0' \ вместо internet.saunalahti пишем точку доступа(APN) для своего оператора.
Сохраняем файлы.
Затем выполняем команду
# pppd call 3g
и сидим в интернете.

[Qt] Activating & flashing(in the task bar) window

Как сделать так, чтобы окно разворачивалось или мигало, если оно свернуто в панель задач?

Для мигания в панели задач(если свернуто, иначе просто станет активным) в классе QWidget есть такой метод:

void activateWindow();

Для разворачивания окна, если оно свернуто так же в классе QWidget есть методы:

void showMinimized();
void showMaximized();
void showFullScreen();
void showNormal();

Макросы из MS Word 2003 в MS Word 2007

Как испльзовать макросы из Word 2003 в Word 2007?
Если у Вас утстановлен в данный момент MS Word 2003, то идем в директорию %APPDATA%\Microsoft\Шаблоны\. Находим там файлик Normal.dot. Если Word 2003 не установлен, то у Вас должен быть файл Normal.dot
Открываем полученный файл в Word 2007. Word ругнется на содержимое. Жмем "Параметры" и включаем макросы. Затем нажимаем Alt + F8. Откроется окно с макросами. Справа нажимаем "Организатор". Далее в левом поле "Макросы и документы" выбираем Normal.dot(Шаблон). В правом поле "Макросы и документы" выбираем Normal.dotm(общий шаблон) и нажимаем кнопку "Копировать ->".
Теперь в любом документе *.docx мы можем использовать свои макросы.