tmuxme 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/README.md +4 -12
- data/bin/tmuxme +24 -2
- data/lib/tmuxme/version.rb +1 -1
- metadata +3 -4
- data/scripts/tmuxme_install +0 -95
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4e26f10f3e6e884b73d8d2ac528e18ba9cc8efd
|
4
|
+
data.tar.gz: cd2a7ddb090c8ca931fb1858bd1793184766f244
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b430ef401e10d02bc813a0acbd36541b965d59b05883409249f5a243d6e31e46757ea8b5228f5c6ddd1c4da8f8e0d9a04cee88711fa86d86cad9a7cd51b196b
|
7
|
+
data.tar.gz: c14fa99ee1eb441bcf820c785972e7d230595d06113d2eff386bd5afc61e7ec0752b26d73a1bd6315b5da5ea1a2b4e5370ad6ebd68c163d15c73c3a24c7bb606
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.0.0-p247
|
data/README.md
CHANGED
@@ -1,24 +1,16 @@
|
|
1
1
|
# TmuxmeClient
|
2
2
|
|
3
|
-
|
3
|
+
The official [tmux.me](http://tmux.me) client application.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
|
7
|
+
Install it yourself as:
|
8
8
|
|
9
|
-
gem
|
10
|
-
|
11
|
-
And then execute:
|
12
|
-
|
13
|
-
$ bundle
|
14
|
-
|
15
|
-
Or install it yourself as:
|
16
|
-
|
17
|
-
$ gem install tmuxme_client
|
9
|
+
$ gem install tmuxme
|
18
10
|
|
19
11
|
## Usage
|
20
12
|
|
21
|
-
|
13
|
+
$ tmuxme <user1> [<user2>...]
|
22
14
|
|
23
15
|
## Contributing
|
24
16
|
|
data/bin/tmuxme
CHANGED
@@ -5,6 +5,7 @@ require 'rest-client'
|
|
5
5
|
require 'net/ssh'
|
6
6
|
require 'json'
|
7
7
|
require 'thread'
|
8
|
+
require 'rbconfig'
|
8
9
|
|
9
10
|
Thread.abort_on_exception = true
|
10
11
|
|
@@ -16,6 +17,25 @@ def generate_authorized_keys_content(public_keys)
|
|
16
17
|
return cleaned_keys.join("\n")
|
17
18
|
end
|
18
19
|
|
20
|
+
|
21
|
+
def os
|
22
|
+
@os ||= (
|
23
|
+
host_os = RbConfig::CONFIG['host_os']
|
24
|
+
case host_os
|
25
|
+
when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
|
26
|
+
:windows
|
27
|
+
when /darwin|mac os/
|
28
|
+
:macosx
|
29
|
+
when /linux/
|
30
|
+
:linux
|
31
|
+
when /solaris|bsd/
|
32
|
+
:unix
|
33
|
+
else
|
34
|
+
:unknown
|
35
|
+
end
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
19
39
|
if ARGV.length < 1
|
20
40
|
puts "You can't pair program with yourself silly."
|
21
41
|
puts "Usage: tmuxme user1 [user2...]"
|
@@ -23,12 +43,14 @@ if ARGV.length < 1
|
|
23
43
|
end
|
24
44
|
|
25
45
|
# Check if remote login is enabled
|
26
|
-
`netstat -an | grep "
|
46
|
+
`netstat -an | grep "[:.]22 " | grep "tcp[^6]" | grep LISTEN`
|
27
47
|
if $? != 0
|
28
48
|
# didn't find it listening on port 22
|
29
49
|
puts "Error: Remote Login is not enabled"
|
30
50
|
puts "tmuxme requires Remote Login to be enabled for this user."
|
31
|
-
|
51
|
+
if os == :macosx
|
52
|
+
puts "Please enable Remote Login in System Preferences -> Sharing -> Remote Login and try again."
|
53
|
+
end
|
32
54
|
exit
|
33
55
|
end
|
34
56
|
|
data/lib/tmuxme/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tmuxme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew De Ponte
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -85,7 +85,6 @@ files:
|
|
85
85
|
- bin/tmuxme
|
86
86
|
- lib/tmuxme.rb
|
87
87
|
- lib/tmuxme/version.rb
|
88
|
-
- scripts/tmuxme_install
|
89
88
|
- tmuxme.gemspec
|
90
89
|
homepage: http://tmux.me
|
91
90
|
licenses:
|
@@ -107,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
106
|
version: '0'
|
108
107
|
requirements: []
|
109
108
|
rubyforge_project:
|
110
|
-
rubygems_version: 2.0.
|
109
|
+
rubygems_version: 2.0.3
|
111
110
|
signing_key:
|
112
111
|
specification_version: 4
|
113
112
|
summary: Command line client for the http://tmux.me pairing service.
|
data/scripts/tmuxme_install
DELETED
@@ -1,95 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
|
3
|
-
function getAvailableHiddenUserUid()
|
4
|
-
{
|
5
|
-
local __UIDS=$(dscl . -list /Users UniqueID | awk '{print $2}' | sort -ugr)
|
6
|
-
local __NewUID
|
7
|
-
for __NewUID in $__UIDS
|
8
|
-
do
|
9
|
-
if [[ $__NewUID -lt 499 && $__NewUID -ne 498 ]] ; then
|
10
|
-
break;
|
11
|
-
fi
|
12
|
-
done
|
13
|
-
|
14
|
-
echo $((__NewUID+1))
|
15
|
-
}
|
16
|
-
|
17
|
-
function generateRandomPassword()
|
18
|
-
{
|
19
|
-
echo `date | md5`
|
20
|
-
}
|
21
|
-
|
22
|
-
|
23
|
-
# Make sure only root can run our script
|
24
|
-
if [[ $EUID -ne 0 ]]; then
|
25
|
-
echo "This script must be run as root" 1>&2
|
26
|
-
exit 1
|
27
|
-
fi
|
28
|
-
|
29
|
-
# USER_UID=499 # this should be a number under 500 so it is a hidden account
|
30
|
-
USER_UID=$(getAvailableHiddenUserUid)
|
31
|
-
|
32
|
-
# This script is design to provide a simple mechanism to help with automating
|
33
|
-
# the process of creating an account for gitosis to use on systems.
|
34
|
-
|
35
|
-
# The following are variables which are likely to change per installation.
|
36
|
-
USERNAME="tmuxme"
|
37
|
-
USER_FULL_NAME="tmuxme"
|
38
|
-
|
39
|
-
# The following are variables unlikely to change but possibly could change
|
40
|
-
# per installation.
|
41
|
-
PRIMARY_GID=1000
|
42
|
-
|
43
|
-
# The following are variables which are highly unlikely to change and may
|
44
|
-
# only change for differences in the operating system.
|
45
|
-
USER_SHELL="/bin/bash" # Mac OS X 10.5.6
|
46
|
-
# LOC_DOMAIN="/Local/Default" # Mac OS X 10.5.6
|
47
|
-
LOC_DOMAIN="." # Mac OS X 10.5.6
|
48
|
-
|
49
|
-
PASSWORD=$(generateRandomPassword)
|
50
|
-
|
51
|
-
# Tell the system to automatically hide user accounts thate have a UID < 500
|
52
|
-
# LOGIN_WIN_PREFS="/Library/Preferences/com.apple.loginwindow"
|
53
|
-
# defaults write ${LOGIN_WIN_PREFS} Hide500Users -bool YES
|
54
|
-
#
|
55
|
-
# Create the user entry.
|
56
|
-
dscl ${LOC_DOMAIN} -create /Users/${USERNAME}
|
57
|
-
|
58
|
-
# Set the users shell.
|
59
|
-
dscl ${LOC_DOMAIN} -create /Users/${USERNAME} UserShell ${USER_SHELL}
|
60
|
-
|
61
|
-
# Set the users full name.
|
62
|
-
dscl ${LOC_DOMAIN} -create /Users/${USERNAME} RealName "${USER_FULL_NAME}"
|
63
|
-
|
64
|
-
# Associate the user with a unique id.
|
65
|
-
dscl ${LOC_DOMAIN} -create /Users/${USERNAME} UniqueID ${USER_UID}
|
66
|
-
|
67
|
-
# Associate the user with a primary gorup id.
|
68
|
-
dscl ${LOC_DOMAIN} -create /Users/${USERNAME} PrimaryGroupID ${PRIMARY_GID}
|
69
|
-
|
70
|
-
# Create the users home directory.
|
71
|
-
dscl ${LOC_DOMAIN} -create /Users/${USERNAME} NFSHomeDirectory /Users/${USERNAME}
|
72
|
-
|
73
|
-
# Set the users password.
|
74
|
-
dscl ${LOC_DOMAIN} -passwd /Users/${USERNAME} ${PASSWORD}
|
75
|
-
|
76
|
-
|
77
|
-
mkdir -p /Users/${USERNAME}/.ssh
|
78
|
-
touch /Users/${USERNAME}/.ssh/authorized_keys
|
79
|
-
chown -R ${USER_UID}:${PRIMARY_GID} /Users/${USERNAME}
|
80
|
-
chmod 0700 /Users/${USERNAME}/.ssh
|
81
|
-
chmod 0600 /Users/${USERNAME}/.ssh/authorized_keys
|
82
|
-
|
83
|
-
# Enable Remote Login if it is not currently enabled.
|
84
|
-
systemsetup -setremotelogin on &>/dev/null
|
85
|
-
|
86
|
-
if [[ $(dscl ${LOC_DOMAIN} list /Groups | grep 'access_ssh') = 'com.apple.access_ssh' ]]; then
|
87
|
-
# Remote Access is limted to specific users
|
88
|
-
USER_GENERATED_UID=$(dscl . -read /Users/${USERNAME} GeneratedUID | awk '{print $2}')
|
89
|
-
dscl ${LOC_DOMAIN} -read /Groups/com.apple.access_ssh GroupMembership | grep ${USERNAME} &>/dev/null
|
90
|
-
if [[ $? -ne 0 ]]; then # user is not in access list
|
91
|
-
# Append the "tmuxme" user to the list of users allowed to connect remotely
|
92
|
-
dscl ${LOC_DOMAIN} -append /Groups/com.apple.access_ssh GroupMembers ${USER_GENERATED_UID}
|
93
|
-
dscl ${LOC_DOMAIN} -append /Groups/com.apple.access_ssh GroupMembership ${USERNAME}
|
94
|
-
fi
|
95
|
-
fi
|