Category Archives: About

Ubuntu: add sign of packages in own repository

This article is extension of http://ag-up.com/ubuntu-create-own-repository/

1. Generate own key
gpg --gen-key
Choose generate sign-only key
enter your Name and Email

2. gpg --armor --export foo@bar.com --output > /opt/repository/ubuntu/public.key where foo@bar.com is Email which you use for generating the key.
3. apt-get install dpkg-sig
dpkg-sig --sign builder /tmp/nginx-ng_1.8.x-1_amd64.deb — sign deb package, use password which you input in the 1st step

4. In the previous article we used command reprepro -C main includedeb precise /tmp/nginx-ng_1.8.x-1_amd64.deb for adding new package in repository,
we have to modify that command to reprepro --ask-passphrase -V -C main includedeb precise /tmp/nginx-at_1.8.x-1_amd64.deb — it'll ask you for key password

5. add to /opt/repository/ubuntu/conf/distributions new option SignWith: yes

On the client side import public key which we exported in step 2:
curl http://packages.localdomain/public.key | apt-key add —
apt-get update

repack initrd

unpack:
file initrd
gzip compressed data, from Unix, last modified: Tue Mar 11 10:56:38 2014, max compression
mv initrd initrd.gz
gunzip initrd.gz

Now we got initrd file, which is cpio archive, unpack it:
cpio -id < initrd

and you could do with it what do you want,

after that we have to pack it again
find ./ |cpio -H newc -o > /tmp/initrd.cpio
gzip < /tmp/initrd.cpio > /tmp/initrd

and we got new initrd !

mongodb: minimal howto

Connect:
mongo --host 10.0.0.1 dbname // host and dbname

Show all databases:
> show dbs

Connect to specific db:
> use dbname

Show all collections (this is tables in the mongo's naming):
> show collections

Show contents of collection:
> db.collection_name.find ().pretty () // db — isn't database name, this is a KEY word, collection_name — is a name of collection which you got with previous command.

Make a select query:
> db.comments.find ({'creatorId':Number (72116967665828320)}).pretty () // select all messages from collection «comments» where field «creatorId» = Number (72116967665828320), type Number very important.

IT Security Brothers (http://itsb.pro)

Hi guys, I would like to present you our new project IT Security Brothers http://itsb.pro
We provide pentest, consultations and IT outsourcing services.
Feel free to hire us for IT jobs.

WP: You are not allowed to edit this post

1. find /var/www/ag-up.com/ -type d -exec chmod 750 {} +
2. find /var/www/ag-up.com/ -type f -exec chmod 640 {} +
3. find /var/www/ag-up.com/ -name wp-config.php -exec chmod 600 {} +
4. find /var/www/ag-up.com/ -name «*.php» -print | xargs sed -i 's/0000-00-00 00:00:00/1000-01-01 00:00:00/g'

os x: time machine, backup to debian squeeze

add to /etc/apt/sources.list
# stable repo
deb http://cdn.debian.net/debian squeeze main
# new testing repo
deb http://cdn.debian.net/debian wheezy main

apt-get update
apt-get install netatalk

edit /etc/netatalk/afpd.conf 
 - -tcp -noddp -uamlist uams_dhx.so,uams_dhx2_passwd.so -nosavepassword -mimicmodel Xserve

edit /etc/netatalk/AppleVolumes.default
/backup/osx «Backup folder» options:usedots,upriv,tm allow:alter,admin

edit /etc/avahi/services/afpd.service 
<service-group>
<name replace-wildcards=”yes”>%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=Xserve</txt-record>
</service>
</service-group>

/etc/init.d/netatalk restart
/etc/init.d/avahi-daemon restart

in the mac os x console:

defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

MySQL: csv output

$q = «select ...where something IN ('...','...','...')»

mysql database -B -h192.168.198.67 -u username -ppassword -e «START TRANSACTION WITH CONSISTENT SNAPSHOT; $q;COMMIT;»

1
| sed 's/\t/,/g'

>> output_file.csv

1km link dir-320 2x

This article — the continuation of the previous how to connect two points via wifi channel.

In a previous article, there are pictures showing the two points where the approximate distance of 1 km in the line of sight. Antenna design can look in the preceding article, as well as all tehinformatsiyu.

This article will describe how to configure these 2 points on the dir-320 for the organization we need the network structure.

We need to configure the network interface to bridge between the LAN and WLAN on both routers, mk we want to organize a «local» network between 2 points. Sorts nat and others we do not need, so wan port routers dir-320 we absolutely will not need it in the firmware dd-wrt you can safely disable.

Well and, accordingly, ethernet cable will be inserted into the LAN ports of points.

Next, you need to log into the web for both routers.

On the ground. We turn to the section wifi.

Type of wireless network -> Access Point

Wireless Mode -> Mixed

Wireless Network Name (SSID) -> any

Mark — in the bridge!

Next section wifi -> expose the necessary security encryption settings of the channel.

On the second. We turn to the section wifi.

All settings are the same, except for the type of wireless network -> Repeater Bridge.

Now in the Status -> System Information can observe in the table radio connection settings, and in "Access Point & Clients quality and channel settings.

I rose up to 24 megabits.

I want to note that the signal strength in milliwatts can be increased, which will increase the signal is done in section wifi -> Advanced -> Transmitter power. Do not put more than 140 — is not very stable, I have put up 100.

So far so if something else has come up with — to supplement article!