Показаны сообщения с ярлыком mac. Показать все сообщения
Показаны сообщения с ярлыком mac. Показать все сообщения

вторник, 28 апреля 2015 г.

Pad file with zeroes (or 0xFF)


So you need to add zeroes (or 0xFF) to the end of file and make resulting file be exact size.
For example, we will make 128kb file from 84kb file with 0xFF at the end.

So basically we open special device /dev/zero and getting zeroes from it. Then we change every 0x00 to 0xFF(tr). then we create 128k size file full of 0xFF(first dd invocation). Then we use dd again to replace beginning of file with our own file - breed-mt7620-reset1.bin. Then just rename our padded file to correct name. Pretty simple.
$ tr "00" "\377" < /dev/zero | dd ibs=1k count=128 of=paddedFile.bin
128+0 records in
256+0 records out
131072 bytes transferred in 0.020307 secs (6454503 bytes/sec)
$ dd if=breed-mt7620-reset1.bin of=paddedFile.bin conv=notrunc
163+1 records in
163+1 records out
83566 bytes transferred in 0.004907 secs (17029502 bytes/sec)
$ mv paddedFile.bin breed-mt7620-reset1_128k.bin
$

вторник, 29 апреля 2014 г.

Secure your mac with your bluetooth-enabled phone, auto-lock it when you're away.


Some time ago i though about security of my laptop. When I'm not at home, at work, for example, i often go away from my macbook and wanted to be sure no one will look at my screen when i'm away. I'm running mac os x, so i found free Proximity app. Get it here
Create new file and type it's full path in Out of Range Script field.
/usr/local/bin/screensaver.scpt
tell application "System Events"
    set ss to screen saver "Random"
    start ss
end tell

All done, now you can walk away from your mac and when you're back - mac is protected with screensaver.

Блокировка mac с помощью мобильного телефона. Bluetooth.


Решил заморочиться с безопасностью ноута. На работе часто бывает, что отходишь от ноута и хочется быть уверенным что лишние глаза не смотрят в твой экран во время твоего отсутствия. На просторах интернета было найдено бесплатное приложение Proximity. Скачать можно тут
Создаем файлик и указываем полный путь до него в настройках в поле Out of Range Script field.
/usr/local/bin/screensaver.scpt
tell application "System Events"
    set ss to screen saver "Random"
    start ss
end tell

Готово! Теперь можно отойти от ноутбука и монитор защищен скринсейвером.