Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
7d30401c
Commit
7d30401c
authored
Jan 12, 2020
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tune_new_user script
parent
689d9ff1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
330 additions
and
0 deletions
+330
-0
tune_new_user.sh
etersoft/tune_new_user.sh
+307
-0
tune_new_user_su.sh
etersoft/tune_new_user_su.sh
+23
-0
No files found.
etersoft/tune_new_user.sh
0 → 100755
View file @
7d30401c
#!/bin/sh
# user setup
#NU="$1"
NU
=
"
$USER
"
DOMAIN
=
"etersoft.ru"
CONSOLEFONT
=
"Droid Sans Mono 11"
[
-n
"
$NU
"
]
||
exit
# skip for these users
case
"
$NU
"
in
lav|kondratyuk
)
exit
;;
esac
NAME
=
"
$(
getent passwd
"
$NU
"
|
cut
-d
":"
-f5
)
"
# set git
git config
--global
user.name
"
$NAME
"
git config
--global
user.email
"
$NU
@
$DOMAIN
"
# fix ssh config
if
[
!
-s
~/.ssh/config
]
||
!
grep
"^Host
\*
"
~/.ssh/config
;
then
cat
<<
EOF
>>~/.ssh/config
Host *
ForwardAgent yes
ForwardX11Trusted yes
ForwardX11 yes
EOF
fi
# tune terminal
mkdir
-p
~/.config/xfce4/terminal/
cat
<<
EOF
>>~/.config/xfce4/terminal/accels.scm
; xfce4-terminal GtkAccelMap rc-file -*- scheme -*-
; this file is an automated accelerator map dump
;
(gtk_accel_path "<Actions>/terminal-window/goto-tab-2" "<Alt>2")
(gtk_accel_path "<Actions>/terminal-window/goto-tab-6" "<Alt>6")
; (gtk_accel_path "<Actions>/terminal-window/copy-input" "")
; (gtk_accel_path "<Actions>/terminal-window/close-other-tabs" "")
(gtk_accel_path "<Actions>/terminal-window/move-tab-right" "<Primary><Shift>Right")
(gtk_accel_path "<Actions>/terminal-window/goto-tab-7" "<Alt>7")
; (gtk_accel_path "<Actions>/terminal-window/set-title-color" "")
; (gtk_accel_path "<Actions>/terminal-window/edit-menu" "")
; (gtk_accel_path "<Actions>/terminal-window/zoom-menu" "")
(gtk_accel_path "<Actions>/terminal-window/goto-tab-1" "<Alt>1")
; (gtk_accel_path "<Actions>/terminal-window/fullscreen" "F11")
; (gtk_accel_path "<Actions>/terminal-window/read-only" "")
; (gtk_accel_path "<Actions>/terminal-window/preferences" "")
; (gtk_accel_path "<Actions>/terminal-window/reset-and-clear" "")
; (gtk_accel_path "<Actions>/terminal-window/about" "")
(gtk_accel_path "<Actions>/terminal-window/goto-tab-5" "<Alt>5")
; (gtk_accel_path "<Actions>/terminal-window/close-window" "<Primary><Shift>q")
; (gtk_accel_path "<Actions>/terminal-window/reset" "")
; (gtk_accel_path "<Actions>/terminal-window/save-contents" "")
; (gtk_accel_path "<Actions>/terminal-window/toggle-menubar" "")
; (gtk_accel_path "<Actions>/terminal-window/copy" "<Primary><Shift>c")
; (gtk_accel_path "<Actions>/terminal-window/copy-html" "")
; (gtk_accel_path "<Actions>/terminal-window/last-active-tab" "")
; (gtk_accel_path "<Actions>/terminal-window/show-borders" "")
; (gtk_accel_path "<Actions>/terminal-window/view-menu" "")
; (gtk_accel_path "<Actions>/terminal-window/detach-tab" "<Primary><Shift>d")
; (gtk_accel_path "<Actions>/terminal-window/scroll-on-output" "")
; (gtk_accel_path "<Actions>/terminal-window/show-toolbar" "")
(gtk_accel_path "<Actions>/terminal-window/next-tab" "<Shift>Right")
; (gtk_accel_path "<Actions>/terminal-window/tabs-menu" "")
; (gtk_accel_path "<Actions>/terminal-window/search-next" "")
; (gtk_accel_path "<Actions>/terminal-window/search-prev" "")
; (gtk_accel_path "<Actions>/terminal-window/undo-close-tab" "")
(gtk_accel_path "<Actions>/terminal-window/set-title" "<Shift><Alt>n")
(gtk_accel_path "<Actions>/terminal-window/contents" "")
; (gtk_accel_path "<Actions>/terminal-window/zoom-reset" "<Primary>0")
; (gtk_accel_path "<Actions>/terminal-window/close-tab" "<Primary><Shift>w")
; (gtk_accel_path "<Actions>/terminal-window/new-tab" "<Primary><Shift>t")
; (gtk_accel_path "<Actions>/terminal-window/new-window" "<Primary><Shift>n")
; (gtk_accel_path "<Actions>/terminal-window/terminal-menu" "")
; (gtk_accel_path "<Actions>/terminal-window/show-menubar" "")
; (gtk_accel_path "<Actions>/terminal-window/select-all" "<Primary><Shift>a")
; (gtk_accel_path "<Actions>/terminal-window/paste" "<Primary><Shift>v")
(gtk_accel_path "<Actions>/terminal-window/goto-tab-9" "<Alt>9")
(gtk_accel_path "<Actions>/terminal-window/move-tab-left" "<Primary><Shift>Left")
; (gtk_accel_path "<Actions>/terminal-window/search" "<Primary><Shift>f")
; (gtk_accel_path "<Actions>/terminal-window/file-menu" "")
(gtk_accel_path "<Actions>/terminal-window/prev-tab" "<Shift>Left")
; (gtk_accel_path "<Actions>/terminal-window/paste-selection" "")
; (gtk_accel_path "<Actions>/terminal-window/zoom-in" "<Primary>plus")
; (gtk_accel_path "<Actions>/terminal-window/zoom-out" "<Primary>minus")
(gtk_accel_path "<Actions>/terminal-window/goto-tab-8" "<Alt>8")
; (gtk_accel_path "<Actions>/terminal-window/help-menu" "")
(gtk_accel_path "<Actions>/terminal-window/goto-tab-4" "<Alt>4")
(gtk_accel_path "<Actions>/terminal-window/goto-tab-3" "<Alt>3")
EOF
mkdir
-p
~/.config/xfce4/terminal/
cat
<<
EOF
>>~/.config/xfce4/terminal/terminalrc
[Configuration]
FontName=
$CONSOLEFONT
MiscAlwaysShowTabs=FALSE
MiscBell=FALSE
MiscBordersDefault=TRUE
MiscCursorBlinks=FALSE
MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK
MiscDefaultGeometry=80x24
MiscInheritGeometry=FALSE
MiscMenubarDefault=TRUE
MiscMouseAutohide=FALSE
MiscToolbarDefault=FALSE
MiscConfirmClose=TRUE
MiscCycleTabs=TRUE
MiscTabCloseButtons=FALSE
MiscTabCloseMiddleClick=TRUE
MiscTabPosition=GTK_POS_BOTTOM
MiscHighlightUrls=TRUE
ScrollingLines=5000
ScrollingOnOutput=FALSE
ScrollingSingleLine=FALSE
ShortcutsNoMenukey=TRUE
ShortcutsNoMnemonics=TRUE
WordChars=-A-Za-z0-9./?%&#:_~@
ColorForeground=#0000ffff0000
ColorCursor=#ffffffffffff
MiscMiddleClickOpensUri=FALSE
ShortcutsNoHelpkey=TRUE
ScrollingUnlimited=TRUE
MiscBellUrgent=FALSE
MiscMouseWheelZoom=TRUE
MiscCopyOnSelect=FALSE
MiscShowRelaunchDialog=TRUE
MiscRewrapOnResize=TRUE
MiscUseShiftArrowsToScroll=FALSE
MiscSlimTabs=FALSE
MiscNewTabAdjacent=FALSE
MiscSearchDialogOpacity=100
MiscShowUnsafePasteDialog=TRUE
MiscDefaultWorkingDir=
EOF
mkdir
-p
~/.config/xfce4/terminal/
cat
<<
EOF
>>~/.config/xfce4/helpers.rc
TerminalEmulator=xfce4-terminal
WebBrowser=chromium
FileManager=Thunar
EOF
mkdir
-p
~/.config/mc/
cat
<<
EOF
>>~/.config/mc/ini
[Midnight-Commander]
verbose=true
shell_patterns=true
auto_save_setup=true
preallocate_space=false
auto_menu=false
use_internal_view=true
use_internal_edit=true
clear_before_exec=true
confirm_delete=true
confirm_overwrite=true
confirm_execute=false
confirm_history_cleanup=true
confirm_exit=false
confirm_directory_hotlist_delete=false
confirm_view_dir=false
safe_delete=false
safe_overwrite=false
use_8th_bit_as_meta=false
mouse_move_pages_viewer=true
mouse_close_dialog=false
fast_refresh=false
drop_menus=false
wrap_mode=true
old_esc_mode=true
cd_symlinks=true
show_all_if_ambiguous=false
use_file_to_guess_type=true
alternate_plus_minus=false
only_leading_plus_minus=true
show_output_starts_shell=false
xtree_mode=false
file_op_compute_totals=true
classic_progressbar=true
use_netrc=true
ftpfs_always_use_proxy=false
ftpfs_use_passive_connections=true
ftpfs_use_passive_connections_over_proxy=false
ftpfs_use_unix_list_options=true
ftpfs_first_cd_then_ls=true
ignore_ftp_chattr_errors=true
editor_fill_tabs_with_spaces=false
editor_return_does_auto_indent=false
editor_backspace_through_tabs=false
editor_fake_half_tabs=false
editor_option_save_position=true
editor_option_auto_para_formatting=false
editor_option_typewriter_wrap=false
editor_edit_confirm_save=true
editor_syntax_highlighting=true
editor_persistent_selections=true
editor_drop_selection_on_copy=true
editor_cursor_beyond_eol=false
editor_cursor_after_inserted_block=false
editor_visible_tabs=true
editor_visible_spaces=true
editor_line_state=false
editor_simple_statusbar=false
editor_check_new_line=false
editor_show_right_margin=false
editor_group_undo=false
editor_state_full_filename=false
editor_ask_filename_before_edit=false
nice_rotating_dash=true
mcview_remember_file_position=false
auto_fill_mkdir_name=true
copymove_persistent_attr=true
pause_after_run=1
mouse_repeat_rate=100
double_click_speed=250
old_esc_mode_timeout=1000000
max_dirt_limit=10
num_history_items_recorded=60
vfs_timeout=60
ftpfs_directory_timeout=900
ftpfs_retry_seconds=30
fish_directory_timeout=900
editor_tab_spacing=4
editor_word_wrap_line_length=72
editor_option_save_mode=0
editor_backup_extension=~
editor_filesize_threshold=64M
editor_stop_format_chars=-+*\\,.;:&>
mcview_eof=
skin=default
filepos_max_saved_entries=1024
[Layout]
message_visible=1
keybar_visible=1
xterm_title=1
output_lines=0
command_prompt=1
menubar_visible=1
free_space=1
horizontal_split=0
vertical_equal=1
left_panel_size=119
horizontal_equal=1
top_panel_size=1
[Misc]
timeformat_recent=%b %e %H:%M
timeformat_old=%b %e %Y
ftp_proxy_host=gate
ftpfs_password=anonymous@
display_codepage=UTF-8
source_codepage=Other_8_bit
autodetect_codeset=
clipboard_store=
clipboard_paste=
[Colors]
base_color=
xterm=
color_terminals=
xterm-256color=
[Panels]
show_mini_info=true
kilobyte_si=false
mix_all_files=false
show_backups=true
show_dot_files=true
fast_reload=false
fast_reload_msg_shown=false
mark_moves_down=true
reverse_files_only=true
auto_save_setup_panels=false
navigate_with_arrows=true
panel_scroll_pages=true
panel_scroll_center=false
mouse_move_pages=true
filetype_mode=true
permission_mode=false
torben_fj_mode=false
quick_search_mode=2
select_flags=6
[Panelize]
Find *.orig after patching=find . -name \\*.orig -print
Find SUID and SGID programs=find . \\( \\( -perm -04000 -a -perm /011 \\) -o \\( -perm -02000 -a -perm /01 \\) \\) -print
Find rejects after patching=find . -name \\*.rej -print
Modified git files=git ls-files --modified
EOF
FIREFOXPREFS
=
$(
echo
~/.mozilla/firefox/
*
/prefs.js
)
if
[
-s
"
$FIREFOXPREFS
"
]
;
then
if
!
grep
"network.negotiate-auth.trusted-uris"
$FIREFOXPREFS
;
then
echo
'user_pref("network.negotiate-auth.trusted-uris", ".etersoft.ru,.eterhost.ru");'
>>
$FIREFOXPREFS
fi
fi
etersoft/tune_new_user_su.sh
0 → 100755
View file @
7d30401c
#!/bin/sh
NU
=
"
$1
"
[
-n
"
$NU
"
]
||
exit
if
[
!
-L
"/home/
$NU
/Projects"
]
;
then
mkdir
-p
/srv/
$NU
/Projects
||
exit
ln
-s
/srv/
$NU
/ /home/
$NU
/Projects
# hektor: /home
if
[
"hektor"
=
"
$(
hostname
-s
)
"
]
;
then
setquota
-u
$NU
-a
20000000 25000000 0 0
fi
# windsor: /srv
# TODO:
if
[
"windsor"
=
"
$(
hostname
-s
)
"
]
;
then
setquota
-u
$NU
-a
20000000 25000000 0 0
fi
fi
# TODO: get path from this script path?
sudo
su -
$NU
-c
"bash -x /srv/lav/Projects/git-eter/etersoft-admin-essential/etersoft/tune_new_user.sh"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment