Category Archives: OS X

Ubuntu: mosh

mosh (Mobile shell)

Ubuntu 14.04 LTS

1
2
3
4
5
6
7
8
9
10
11
12
echo >> /etc/apt/sources.list.d/mosh.list << EOF
deb http://ppa.launchpad.net/keithw/mosh/ubuntu trusty main
deb-src http://ppa.launchpad.net/keithw/mosh/ubuntu trusty main
EOF


apt-get update
get error about key(for example: 7BF6DFCD) copy it and insert
gpg --keyserver hkp://keys.gnupg.net --recv-keys 7BF6DFCD
gpg -a --export 7BF6DFCD | sudo apt-key add -

apt-get update
apt-get install mosh

OS X

1
brew install mosh

Usage

1
2
mosh example.com # it connects with current user on default ssh port(22)
mosh --ssh="ssh -p33" alter@example.com # it connects with user "alter" to port 33

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.

Issue with Steam on OS X

Are you running steam and it closes ?
You could try to use next command (for command-line interface):
mv /Users/admin/Library/Application\ Support/Steam/registry.vdf /Users/admin/Library/Application\ Support/Steam/registry.vdi; open -a /Applications/Steam.app --args -tcp

where 'admin' is username.

I've added it like alias in the shell file (it could be ~/.zshrc, ~/.bashrc, /etc/zshrc, /etc/bashrc and so on it depends on your shell, by default it's a BASH):
alias csgo='mv /Users/admin/Library/Application\ Support/Steam/registry.vdf /Users/admin/Library/Application\ Support/Steam/registry.vdi; open -a /Applications/Steam.app --args -tcp'

after reloading of rc file I could use command:
csgo

Xcode: DatePicker instead of keyboard

If you would like to use DatePicker instead of default keyboard when you make tap on the textField you should write following code:

in the ViewContoller.m file add method

1
2
3
4
5
6
7
8
9
10
11
-(void)updateTextField:(id)sender
{
  if([_editStartDate isFirstResponder]){
    UIDatePicker *picker = (UIDatePicker*)_editStartDate.inputView;
    _editStartDate.text = [NSString stringWithFormat:@"%@",picker.date];
  }
  if([_editEndDate isFirstResponder]){
    UIDatePicker *picker = (UIDatePicker*)_editEndDate.inputView;
    _editEndDate.text = [NSString stringWithFormat:@"%@",picker.date];  
  }
}

where _editStartDate and _editEndDate are textFields
and in the default method of controller's implementation:

1
2
3
4
5
6
7
8
9
10
11
12
- (void)viewDidLoad
{
  UIDatePicker *datePicker = [[UIDatePicker alloc]init];

  [datePicker setDate:[NSDate date]];
  [datePicker addTarget:self action:@selector(updateTextField:) forControlEvents:UIControlEventValueChanged];
  [_editStartDate setInputView:datePicker];

  [datePicker addTarget:self action:@selector(updateTextField:) forControlEvents:UIControlEventValueChanged];
  [_editEndDate setInputView:datePicker];
...
}

Result:
DatePicker_textField

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