Skip to content

Commit

Permalink
Fix position of parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jan 16, 2024
1 parent 2407e57 commit 37b8df9
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 14 deletions.
39 changes: 39 additions & 0 deletions doc/Documentation SellYourSaas - Developer station - EN.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,45 @@ X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
---------------


=== Installation of keyboard macros

apt install xbindkeys xbindkeys-config xautomation

Edit the macro file *~/.xbindkeysrc* to add your macro instruction

[source,txt]
---------------
###########################
# xbindkeys configuration #
###########################
#keystate_numlock = enable
#keystate_scrolllock = enable
#keystate_capslock = enable
# Macro 1 to ouptu string to show then Enter
"xte 'usleep 300000' 'str string to show' 'key Return'"
m:0x11 + c:61
Shift+Mod2 + exclam + Release
#
# End of xbindkeys configuration
---------------

Note: You can also edit the macro file using xbindkeys-config


To test the macro file, run:

[source,txt]
---------------
xbindkeys -n
---------------

and type the command key onto another terminal.
If it's ok, you can launch at startup the command *xbindkeys*.


=== Installation of the sound output switcher ===

[source,bash]
Expand Down
4 changes: 2 additions & 2 deletions scripts/ansible/user_create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
user:
name: '{{ login }}'
shell: /bin/bash
comment: "User created from desktop_admin_users.php"
comment: "User created or modified from desktop_admin_users.php"

- name: Set public key of user
authorized_key:
Expand Down Expand Up @@ -179,7 +179,7 @@
user:
name: '{{ login }}'
shell: /bin/bash
comment: "User created from desktop_admin_users.php"
comment: "User created or modified from desktop_admin_users.php"
password: '{{ userpassword }}'
update_password: always
when:
Expand Down
26 changes: 14 additions & 12 deletions scripts/desktop_admin_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,19 @@
print 'Administer unix users of a SellYourSaas infrastructure remotely.'."\n";
print "This script must be ran remotely from an allowed desktop.\n";
print "\n";
print "Usage:\n".$script_file." (create|update|deactivate|reactivate|remove) logintoupdate hostfile (master,deployment,web) [loginforansible] [userroot=0|1] [userip=userip] [userpublickey=\"userpublickey\"] [userpassword=\"userpassword\"]\n";
print "Usage:\n".$script_file." hostfile (master,deployment,web) (create|update|deactivate|reactivate|remove) logintoupdate [loginforansible] [userroot=0|1] [userip=userip] [userpublickey=\"userpublickey\"] [userpassword=\"userpassword\"]\n";
print "\n";
print "Example:\n";
print "- To create a sysadmin user (like the first one, root allowed):\n";
print $script_file.' create logintocreate hostfile master,deployment,web ubuntu userroot=1 userpassword=... userpublickey="ABC..."'."\n";
print " ".$script_file.' create hostfile master,deployment,web logintocreate ubuntu userroot=1 userpassword=... userpublickey="ABC..."'."\n";
print "- To add a sysadmin user (root not allowed):\n";
print $script_file.' create logintocreate hostfile master,deployment,web userroot=0 userip=ipofuser userpassword=... userpublickey="ABC..."'."\n";
print "- To update a user (for example to change root access):\n";
print $script_file.' update logintoupdate hostfile withX.sellyoursaasdomain.com userroot=X'."\n";
print " ".$script_file.' create hostfile master,deployment,web logintocreate userroot=0 userip=ipofuser userpassword=... userpublickey="ABC..."'."\n";
print "- To update a user (for example to change root access or change password):\n";
print " ".$script_file.' update hostfile withX.sellyoursaasdomain.com logintoupdate userroot=X userpassword=...'."\n";
print "- To remove a disable/reenable a user:\n";
print " ".$script_file.' deactivate hostfile master,deployment,web logintodeactivate'."\n";
print "- To remove a user:\n";
print $script_file.' remove logintodelete hostfile master,deployment,web'."\n";
print " ".$script_file.' remove hostfile master,deployment,web logintodelete'."\n";
exit(-1);
}
print '--- start'."\n";
Expand All @@ -106,10 +108,10 @@
$now = time();

// mandatory params
$action = isset($argv[1]) ? $argv[1] : '';
$login = isset($argv[2]) ? $argv[2] : '';
$hostfile = isset($argv[3]) ? $argv[3] : '';
$target = empty($argv[4]) ? '' : $argv[4];
$hostfile = isset($argv[1]) ? $argv[1] : '';
$target = empty($argv[2]) ? '' : $argv[2];
$action = isset($argv[3]) ? $argv[3] : '';
$login = isset($argv[4]) ? $argv[4] : '';

$loginforansible = isset($argv[5]) ? $argv[5] : '';
if (strpos($loginforansible, '=') !== false) {
Expand Down Expand Up @@ -162,9 +164,9 @@
} elseif ($action == 'remove') {
$scriptyaml = 'user_remove.yml';
} else {
echo "Error: Bad parameter action. Must be (create|deactivate|reactivate|remove).\n";
echo "Error: Bad parameter action '".$action."'. Must be (create|deactivate|reactivate|remove).\n";
echo "\n";
print "Usage:\n".$script_file." (create|deactivate|reactivate|remove) logintoupdate hostfile (master,deployment,web) [loginforansible] [userip=userip] [userroot=0|1] [userpublickey=\"userpublickey\"] [userpassword=\"userpassword\"]\n";
print "Usage:\n".$script_file." hostfile (master,deployment,web) (create|deactivate|reactivate|remove) logintoupdate [loginforansible] [userip=userip] [userroot=0|1] [userpublickey=\"userpublickey\"] [userpassword=\"userpassword\"]\n";
exit(-1);
}

Expand Down

0 comments on commit 37b8df9

Please sign in to comment.