From: xf0r3m Date: Sat, 25 Apr 2026 06:55:24 +0000 (+0200) Subject: Dostosowanie do wersji 3.0, cz. 2 X-Git-Url: https://gitweb.morketsmerke.org/?a=commitdiff_plain;h=9ad7f44dc8be11f8665d7d79e267e9e9b0ddc827;p=immudex.git Dostosowanie do wersji 3.0, cz. 2 --- diff --git a/files/config b/files/config new file mode 100644 index 0000000..a6a5b59 --- /dev/null +++ b/files/config @@ -0,0 +1,322 @@ +servers = ( + { address = "irc.dal.net"; chatnet = "DALnet"; port = "6667"; }, + { + address = "ssl.efnet.org"; + chatnet = "EFNet"; + port = "9999"; + use_tls = "yes"; + }, + { + address = "irc.esper.net"; + chatnet = "EsperNet"; + port = "6697"; + use_tls = "yes"; + tls_verify = "yes"; + }, + { + address = "chat.freenode.net"; + chatnet = "Freenode"; + port = "6697"; + use_tls = "yes"; + tls_verify = "yes"; + }, + { + address = "irc.gamesurge.net"; + chatnet = "GameSurge"; + port = "6667"; + }, + { + address = "eu.irc6.net"; + chatnet = "IRCnet"; + port = "6667"; + use_tls = "yes"; + }, + { address = "open.ircnet.net"; chatnet = "IRCnet"; port = "6667"; }, + { + address = "irc.ircsource.net"; + chatnet = "IRCSource"; + port = "6667"; + }, + { address = "irc.netfuze.net"; chatnet = "NetFuze"; port = "6667"; }, + { + address = "irc.oftc.net"; + chatnet = "OFTC"; + port = "6697"; + use_tls = "yes"; + tls_verify = "yes"; + }, + { + address = "irc.quakenet.org"; + chatnet = "QuakeNet"; + port = "6667"; + }, + { + address = "irc.rizon.net"; + chatnet = "Rizon"; + port = "6697"; + use_tls = "yes"; + tls_verify = "yes"; + }, + { address = "silc.silcnet.org"; chatnet = "SILC"; port = "706"; }, + { + address = "irc.undernet.org"; + chatnet = "Undernet"; + port = "6667"; + }, + { + address = "irc.morketsmerke.org"; + chatnet = "morketsmerke.org"; + port = "6697"; + use_tls = "yes"; + tls_verify = "yes"; + tls_capath = "/etc/ssl/certs"; + autoconnect = "yes"; + } +); + +chatnets = { + DALnet = { + type = "IRC"; + max_kicks = "4"; + max_msgs = "20"; + max_whois = "30"; + }; + EFNet = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "4"; + max_whois = "1"; + }; + EsperNet = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "4"; + max_whois = "1"; + }; + Freenode = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "4"; + max_whois = "1"; + }; + GameSurge = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "1"; + max_whois = "1"; + }; + IRCnet = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "1"; + max_whois = "1"; + }; + IRCSource = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "4"; + max_whois = "1"; + }; + NetFuze = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "1"; + max_whois = "1"; + }; + OFTC = { type = "IRC"; max_kicks = "1"; max_msgs = "1"; max_whois = "1"; }; + QuakeNet = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "1"; + max_whois = "1"; + }; + Rizon = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "1"; + max_whois = "1"; + }; + SILC = { type = "SILC"; }; + Undernet = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "1"; + max_whois = "1"; + }; + "morketsmerke.net" = { type = "IRC"; }; + "morketsmerke.org" = { type = "IRC"; }; +}; + +channels = ( + { name = "#lobby"; chatnet = "EsperNet"; autojoin = "No"; }, + { name = "#freenode"; chatnet = "Freenode"; autojoin = "No"; }, + { name = "#irssi"; chatnet = "Freenode"; autojoin = "No"; }, + { name = "#gamesurge"; chatnet = "GameSurge"; autojoin = "No"; }, + { name = "#irssi"; chatnet = "IRCNet"; autojoin = "No"; }, + { name = "#ircsource"; chatnet = "IRCSource"; autojoin = "No"; }, + { name = "#netfuze"; chatnet = "NetFuze"; autojoin = "No"; }, + { name = "#oftc"; chatnet = "OFTC"; autojoin = "No"; }, + { name = "silc"; chatnet = "SILC"; autojoin = "No"; }, + { + name = "#general"; + chatnet = "morketsmerke.net"; + autojoin = "yes"; + } +); + +aliases = { + ATAG = "WINDOW SERVER"; + ADDALLCHANS = "SCRIPT EXEC foreach my \\$channel (Irssi::channels()) { Irssi::command(\"CHANNEL ADD -auto \\$channel->{visible_name} \\$channel->{server}->{tag} \\$channel->{key}\")\\;}"; + B = "BAN"; + BACK = "AWAY"; + BANS = "BAN"; + BYE = "QUIT"; + C = "CLEAR"; + CALC = "EXEC - if command -v bc >/dev/null 2>&1\\; then printf '%s=' '$*'\\; echo '$*' | bc -l\\; else echo bc was not found\\; fi"; + CHAT = "DCC CHAT"; + DATE = "TIME"; + DEHIGHLIGHT = "DEHILIGHT"; + DESCRIBE = "ACTION"; + DHL = "DEHILIGHT"; + EXEMPTLIST = "MODE $C +e"; + EXIT = "QUIT"; + GOTO = "SCROLLBACK GOTO"; + HIGHLIGHT = "HILIGHT"; + HL = "HILIGHT"; + HOST = "USERHOST"; + INVITELIST = "MODE $C +I"; + J = "JOIN"; + K = "KICK"; + KB = "KICKBAN"; + KN = "KNOCKOUT"; + LAST = "LASTLOG"; + LEAVE = "PART"; + M = "MSG"; + MUB = "UNBAN *"; + N = "NAMES"; + NMSG = "^MSG"; + P = "PART"; + Q = "QUERY"; + RESET = "SET -default"; + RUN = "SCRIPT LOAD"; + SAY = "MSG *"; + SB = "SCROLLBACK"; + SBAR = "STATUSBAR"; + SIGNOFF = "QUIT"; + SV = "MSG * Irssi $J ($V) - https://irssi.org"; + T = "TOPIC"; + UB = "UNBAN"; + UMODE = "MODE $N"; + UNSET = "SET -clear"; + W = "WHO"; + WC = "WINDOW CLOSE"; + WG = "WINDOW GOTO"; + WJOIN = "JOIN -window"; + WI = "WHOIS"; + WII = "WHOIS $0 $0"; + WL = "WINDOW LIST"; + WN = "WINDOW NEW HIDDEN"; + WQUERY = "QUERY -window"; + WW = "WHOWAS"; +}; + +statusbar = { + + items = { + + barstart = "{sbstart}"; + barend = "{sbend}"; + + topicbarstart = "{topicsbstart}"; + topicbarend = "{topicsbend}"; + + time = "{sb $Z}"; + user = "{sb {sbnickmode $cumode}$N{sbmode $usermode}{sbaway $A}}"; + + window = "{sb $winref:$tag/$itemname{sbmode $M}}"; + window_empty = "{sb $winref{sbservertag $tag}}"; + + prompt = "{prompt $[.15]itemname}"; + prompt_empty = "{prompt $winname}"; + + topic = " $topic"; + topic_empty = " Irssi v$J - https://irssi.org"; + + lag = "{sb Lag: $0-}"; + act = "{sb Act: $0-}"; + more = "-- more --"; + }; + + default = { + + window = { + + disabled = "no"; + type = "window"; + placement = "bottom"; + position = "1"; + visible = "active"; + + items = { + barstart = { priority = "100"; }; + time = { }; + user = { }; + window = { }; + window_empty = { }; + lag = { priority = "-1"; }; + act = { priority = "10"; }; + more = { priority = "-1"; alignment = "right"; }; + barend = { priority = "100"; alignment = "right"; }; + }; + }; + + window_inact = { + + type = "window"; + placement = "bottom"; + position = "1"; + visible = "inactive"; + + items = { + barstart = { priority = "100"; }; + window = { }; + window_empty = { }; + more = { priority = "-1"; alignment = "right"; }; + barend = { priority = "100"; alignment = "right"; }; + }; + }; + + prompt = { + + type = "root"; + placement = "bottom"; + position = "100"; + visible = "always"; + + items = { + prompt = { priority = "-1"; }; + prompt_empty = { priority = "-1"; }; + input = { priority = "10"; }; + }; + }; + + topic = { + + type = "root"; + placement = "top"; + position = "1"; + visible = "always"; + + items = { + topicbarstart = { priority = "100"; }; + topic = { }; + topic_empty = { }; + topicbarend = { priority = "100"; alignment = "right"; }; + }; + }; + }; +}; +settings = { + core = { real_name = "Unknown"; user_name = "xf0r3m"; nick = "xf0r3m"; }; + "fe-text" = { actlist_sort = "refnum"; }; +}; diff --git a/files/default.theme b/files/default.theme new file mode 100644 index 0000000..79b1af5 --- /dev/null +++ b/files/default.theme @@ -0,0 +1,295 @@ +# When testing changes, the easiest way to reload the theme is with /RELOAD. +# This reloads the configuration file too, so if you did any changes remember +# to /SAVE it first. Remember also that /SAVE overwrites the theme file with +# old data so keep backups :) + +# TEMPLATES: + +# The real text formats that irssi uses are the ones you can find with +# /FORMAT command. Back in the old days all the colors and texts were mixed +# up in those formats, and it was really hard to change the colors since you +# might have had to change them in tens of different places. So, then came +# this templating system. + +# Now the /FORMATs don't have any colors in them, and they also have very +# little other styling. Most of the stuff you need to change is in this +# theme file. If you can't change something here, you can always go back +# to change the /FORMATs directly, they're also saved in these .theme files. + +# So .. the templates. They're those {blahblah} parts you see all over the +# /FORMATs and here. Their usage is simply {name parameter1 parameter2}. +# When irssi sees this kind of text, it goes to find "name" from abstracts +# block below and sets "parameter1" into $0 and "parameter2" into $1 (you +# can have more parameters of course). Templates can have subtemplates. +# Here's a small example: +# /FORMAT format hello {colorify {underline world}} +# abstracts = { colorify = "%G$0-%n"; underline = "%U$0-%U"; } +# When irssi expands the templates in "format", the final string would be: +# hello %G%Uworld%U%n +# ie. underlined bright green "world" text. +# and why "$0-", why not "$0"? $0 would only mean the first parameter, +# $0- means all the parameters. With {underline hello world} you'd really +# want to underline both of the words, not just the hello (and world would +# actually be removed entirely). + +# COLORS: + +# You can find definitions for the color format codes in docs/formats.txt. + +# There's one difference here though. %n format. Normally it means the +# default color of the terminal (white mostly), but here it means the +# "reset color back to the one it was in higher template". For example +# if there was /FORMAT test %g{foo}bar, and foo = "%Y$0%n", irssi would +# print yellow "foo" (as set with %Y) but "bar" would be green, which was +# set at the beginning before the {foo} template. If there wasn't the %g +# at start, the normal behaviour of %n would occur. If you _really_ want +# to use the terminal's default color, use %N. + +############################################################################# + +# default foreground color (%N) - -1 is the "default terminal color" +default_color = "-1"; + +# print timestamp/servertag at the end of line, not at beginning +info_eol = "false"; + +# these characters are automatically replaced with specified color +# (dark grey by default) +replaces = { "[]=" = "%K$*%n"; }; + +abstracts = { + ## + ## generic + ## + + # text to insert at the beginning of each non-message line + line_start = "%B-%n!%B-%n "; + + # timestamp styling, nothing by default + timestamp = "$*"; + + # any kind of text that needs hilighting, default is to bold + hilight = "%_$*%_"; + + # any kind of error message, default is bright red + error = "%R$*%n"; + + # channel name is printed + channel = "%_$*%_"; + + # nick is printed + nick = "%_$*%_"; + + # nick host is printed + nickhost = "[$*]"; + + # server name is printed + server = "%_$*%_"; + + # some kind of comment is printed + comment = "[$*]"; + + # reason for something is printed (part, quit, kick, ..) + reason = "{comment $*}"; + + # mode change is printed ([+o nick]) + mode = "{comment $*}"; + + ## + ## channel specific messages + ## + + # highlighted nick/host is printed (joins) + channick_hilight = "%C$*%n"; + chanhost_hilight = "{nickhost %c$*%n}"; + + # nick/host is printed (parts, quits, etc.) + channick = "%c$*%n"; + chanhost = "{nickhost $*}"; + + # highlighted channel name is printed + channelhilight = "%c$*%n"; + + # ban/ban exception/invite list mask is printed + ban = "%c$*%n"; + + ## + ## messages + ## + + # the basic styling of how to print message, $0 = nick mode, $1 = nick + msgnick = "%K<%n$0$1-%K>%n %|"; + + # message from you is printed. "ownnick" specifies the styling of the + # nick ($0 part in msgnick) and "ownmsgnick" specifies the styling of the + # whole line. + + # Example1: You want the message text to be green: + # ownmsgnick = "{msgnick $0 $1-}%g"; + # Example2.1: You want < and > chars to be yellow: + # ownmsgnick = "%Y{msgnick $0 $1-%Y}%n"; + # (you'll also have to remove <> from replaces list above) + # Example2.2: But you still want to keep <> grey for other messages: + # pubmsgnick = "%K{msgnick $0 $1-%K}%n"; + # pubmsgmenick = "%K{msgnick $0 $1-%K}%n"; + # pubmsghinick = "%K{msgnick $1 $0$2-%n%K}%n"; + # ownprivmsgnick = "%K{msgnick $*%K}%n"; + # privmsgnick = "%K{msgnick %R$*%K}%n"; + + # $0 = nick mode, $1 = nick + ownmsgnick = "{msgnick $0 $1-}"; + ownnick = "%_$*%n"; + + # public message in channel, $0 = nick mode, $1 = nick + pubmsgnick = "{msgnick $0 $1-}"; + pubnick = "%N$*%n"; + + # public message in channel meant for me, $0 = nick mode, $1 = nick + pubmsgmenick = "{msgnick $0 $1-}"; + menick = "%Y$*%n"; + + # public highlighted message in channel + # $0 = highlight color, $1 = nick mode, $2 = nick + pubmsghinick = "{msgnick $1 $0$2-%n}"; + + # channel name is printed with message + msgchannel = "%K:%c$*%n"; + + # private message, $0 = nick, $1 = host + privmsg = "[%R$0%K(%r$1-%K)%n] "; + + # private message from you, $0 = "msg", $1 = target nick + ownprivmsg = "[%r$0%K(%R$1-%K)%n] "; + + # own private message in query + ownprivmsgnick = "{msgnick $*}"; + ownprivnick = "%_$*%n"; + + # private message in query + privmsgnick = "{msgnick %R$*%n}"; + + ## + ## Actions (/ME stuff) + ## + + # used internally by this theme + action_core = "%_ * $*%n"; + + # generic one that's used by most actions + action = "{action_core $*} "; + + # own action, both private/public + ownaction = "{action $*}"; + + # own action with target, both private/public + ownaction_target = "{action_core $0}%K:%c$1%n "; + + # private action sent by others + pvtaction = "%_ (*) $*%n "; + pvtaction_query = "{action $*}"; + + # public action sent by others + pubaction = "{action $*}"; + + + ## + ## other IRC events + ## + + # whois + whois = "%# $[8]0 : $1-"; + + # notices + ownnotice = "[%r$0%K(%R$1-%K)]%n "; + notice = "%K-%M$*%K-%n "; + pubnotice_channel = "%K:%m$*"; + pvtnotice_host = "%K(%m$*%K)"; + servernotice = "%g!$*%n "; + + # CTCPs + ownctcp = "[%r$0%K(%R$1-%K)] "; + ctcp = "%g$*%n"; + + # wallops + wallop = "%_$*%n: "; + wallop_nick = "%n$*"; + wallop_action = "%_ * $*%n "; + + # netsplits + netsplit = "%R$*%n"; + netjoin = "%C$*%n"; + + # /names list + names_prefix = ""; + names_nick = "[%_$0%_$1-] "; + names_nick_op = "{names_nick $*}"; + names_nick_halfop = "{names_nick $*}"; + names_nick_voice = "{names_nick $*}"; + names_users = "[%g$*%n]"; + names_channel = "%G$*%n"; + + # DCC + dcc = "%g$*%n"; + dccfile = "%_$*%_"; + + # DCC chat, own msg/action + dccownmsg = "[%r$0%K($1-%K)%n] "; + dccownnick = "%R$*%n"; + dccownquerynick = "%_$*%n"; + dccownaction = "{action $*}"; + dccownaction_target = "{action_core $0}%K:%c$1%n "; + + # DCC chat, others + dccmsg = "[%G$1-%K(%g$0%K)%n] "; + dccquerynick = "%G$*%n"; + dccaction = "%_ (*dcc*) $*%n %|"; + + ## + ## statusbar + ## + + # default background for all statusbars. You can also give + # the default foreground color for statusbar items. + sb_background = "%4%w"; + window_border = "%4%w"; + + # default backround for "default" statusbar group + #sb_default_bg = "%4"; + # background for prompt / input line + sb_prompt_bg = "%n"; + # background for info statusbar + sb_info_bg = "%8"; + # background for topicbar (same default) + #sb_topic_bg = "%4"; + + # text at the beginning of statusbars. "sb" already puts a space there, + # so we don't use anything by default. + sbstart = ""; + # text at the end of statusbars. Use space so that it's never + # used for anything. + sbend = " "; + + topicsbstart = "{sbstart $*}"; + topicsbend = "{sbend $*}"; + + prompt = "[$*] "; + + sb = " %c[%n$*%c]%n"; + sbmode = "(%c+%n$*)"; + sbaway = " (%GzZzZ%n)"; + sbservertag = ":$0 (change with ^X)"; + sbnickmode = "$0"; + + # activity in statusbar + + # ',' separator + sb_act_sep = "%c$*"; + # normal text + sb_act_text = "%c$*"; + # public message + sb_act_msg = "%W$*"; + # hilight + sb_act_hilight = "%M$*"; + # hilight with specified color, $0 = color, $1 = text + sb_act_hilight_color = "$0$1-%n"; +}; diff --git a/files/whiskermenu-1.rc b/files/whiskermenu-1.rc deleted file mode 100644 index 8d7be11..0000000 --- a/files/whiskermenu-1.rc +++ /dev/null @@ -1,81 +0,0 @@ -favorites=gvim.desktop,firefox-esr-immudex.desktop,thunderbird-immudex.desktop,org.keepassxc.KeePassXC-immudex.desktop,com.nextcloud.desktopclient.nextcloud-immudex.desktop -recent= -button-title=Start -button-icon=debian-logo -button-single-row=false -show-button-title=true -show-button-icon=true -launcher-show-name=true -launcher-show-description=true -launcher-show-tooltip=true -item-icon-size=3 -hover-switch-category=false -category-show-name=true -category-icon-size=1 -load-hierarchy=false -view-as-icons=false -default-category=0 -recent-items-max=10 -favorites-in-recent=true -position-search-alternate=true -position-commands-alternate=false -position-categories-alternate=true -stay-on-focus-out=false -confirm-session-command=true -menu-width=450 -menu-height=500 -menu-opacity=100 -command-settings=xfce4-settings-manager -show-command-settings=true -command-lockscreen=xflock4 -show-command-lockscreen=true -command-switchuser=dm-tool switch-to-greeter -show-command-switchuser=false -command-logoutuser=xfce4-session-logout --logout --fast -show-command-logoutuser=true -command-restart=xfce4-session-logout --reboot --fast -show-command-restart=true -command-shutdown=xfce4-session-logout --halt --fast -show-command-shutdown=true -command-suspend=xfce4-session-logout --suspend -show-command-suspend=true -command-hibernate=xfce4-session-logout --hibernate -show-command-hibernate=false -command-logout=xfce4-session-logout -show-command-logout=false -command-menueditor=menulibre -show-command-menueditor=true -command-profile=mugshot -show-command-profile=true -search-actions=5 - -[action0] -name=Strony podręcznika -pattern=# -command=exo-open --launch TerminalEmulator man %s -regex=false - -[action1] -name=Wyszukiwarka internetowa -pattern=? -command=exo-open --launch WebBrowser https://duckduckgo.com/?q=%u -regex=false - -[action2] -name=Wikipedia -pattern=!w -command=exo-open --launch WebBrowser https://en.wikipedia.org/wiki/%u -regex=false - -[action3] -name=Uruchom w terminalu -pattern=! -command=exo-open --launch TerminalEmulator %s -regex=false - -[action4] -name=Otwórz adres URI -pattern=^(file|http|https):\\/\\/(.*)$ -command=exo-open \\0 -regex=true - diff --git a/immudex-build b/immudex-build index fa08174..f109e0c 100755 --- a/immudex-build +++ b/immudex-build @@ -107,7 +107,7 @@ sudo chroot ${HOME}/build/immudex-${debver}/${arch}/chroot /bin/bash /base.sh $d #Try to umount system interfaces it may fail. for i in /dev/pts /proc /run /sys /dev; do - sudo umount ${HOME}/build/immudex-${debver}/${arch}/chroot$i; + sudo umount -f ${HOME}/build/immudex-${debver}/${arch}/chroot$i; done #Removing chroot script. diff --git a/launchers/16844254192.desktop b/launchers/16844254192.desktop deleted file mode 100644 index 98982cf..0000000 --- a/launchers/16844254192.desktop +++ /dev/null @@ -1,19 +0,0 @@ -[Desktop Entry] -Name=Librewolf (Firejailed) -Name[pl]=Librewolf (Firejailed) -Comment=Browse the World Wide Web -Comment[pl]=Bezpieczne przeglądanie stron WWW -GenericName=Web Browser -GenericName[pl]=Przeglądarka WWW -X-GNOME-FullName=Firefox ESR Web Browser -X-GNOME-FullName[pl]=Przeglądarka WWW Firefox ESR -Exec=/usr/local/bin/immudex-secured-librewolf -Terminal=false -X-MultipleArgs=false -Type=Application -Icon=librewolf -Categories=Network;WebBrowser; -MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;x-scheme-handler/http;x-scheme-handler/https; -StartupWMClass=Firefox-esr -StartupNotify=true -X-XFCE-Source=file:///usr/share/applications/firefox-esr.desktop diff --git a/launchers/firefox-esr-immudex.desktop b/launchers/firefox-esr-immudex.desktop deleted file mode 100644 index 0bd1442..0000000 --- a/launchers/firefox-esr-immudex.desktop +++ /dev/null @@ -1,104 +0,0 @@ -[Desktop Entry] -Name=Firefox ESR (immudex) -Name[bg]=Firefox ESR -Name[ca]=Firefox ESR -Name[cs]=Firefox ESR -Name[el]=Firefox ESR -Name[es]=Firefox ESR -Name[fa]=Firefox ESR -Name[fi]=Firefox ESR -Name[fr]=Firefox ESR -Name[hu]=Firefox ESR -Name[it]=Firefox ESR -Name[ja]=Firefox ESR -Name[ko]=Firefox ESR -Name[nb]=Firefox ESR -Name[nl]=Firefox ESR -Name[nn]=Firefox ESR -Name[no]=Firefox ESR -Name[pl]=Firefox ESR (immudex) -Name[pt]=Firefox ESR -Name[pt_BR]=Firefox ESR -Name[ru]=Firefox ESR -Name[sk]=Firefox ESR -Name[sv]=Firefox ESR -Comment=Browse the World Wide Web -Comment[bg]=Сърфиране в Мрежата -Comment[ca]=Navegueu per el web -Comment[cs]=Prohlížení stránek World Wide Webu -Comment[de]=Im Internet surfen -Comment[el]=Περιηγηθείτε στον παγκόσμιο ιστό -Comment[es]=Navegue por la web -Comment[fa]=صفحات شبکه جهانی اینترنت را مرور نمایید -Comment[fi]=Selaa Internetin WWW-sivuja -Comment[fr]=Navigue sur Internet -Comment[hu]=A világháló böngészése -Comment[it]=Esplora il web -Comment[ja]=ウェブを閲覧します -Comment[ko]=웹을 돌아 다닙니다 -Comment[nb]=Surf på nettet -Comment[nl]=Verken het internet -Comment[nn]=Surf på nettet -Comment[no]=Surf på nettet -Comment[pl]=Przeglądanie stron WWW -Comment[pt]=Navegue na Internet -Comment[pt_BR]=Navegue na Internet -Comment[ru]=Обозреватель Всемирной Паутины -Comment[sk]=Prehliadanie internetu -Comment[sv]=Surfa på webben -GenericName=Web Browser -GenericName[bg]=Интернет браузър -GenericName[ca]=Navegador web -GenericName[cs]=Webový prohlížeč -GenericName[de]=Webbrowser -GenericName[el]=Περιηγητής ιστού -GenericName[es]=Navegador web -GenericName[fa]=مرورگر اینترنتی -GenericName[fi]=WWW-selain -GenericName[fr]=Navigateur Web -GenericName[hu]=Webböngésző -GenericName[it]=Browser Web -GenericName[ja]=ウェブ・ブラウザ -GenericName[ko]=웹 브라우저 -GenericName[nb]=Nettleser -GenericName[nl]=Webbrowser -GenericName[nn]=Nettlesar -GenericName[no]=Nettleser -GenericName[pl]=Przeglądarka WWW -GenericName[pt]=Navegador Web -GenericName[pt_BR]=Navegador Web -GenericName[ru]=Интернет-браузер -GenericName[sk]=Internetový prehliadač -GenericName[sv]=Webbläsare -X-GNOME-FullName=Firefox ESR Web Browser -X-GNOME-FullName[bg]=Интернет браузър (Firefox ESR) -X-GNOME-FullName[ca]=Navegador web Firefox ESR -X-GNOME-FullName[cs]=Firefox ESR Webový prohlížeč -X-GNOME-FullName[el]=Περιηγήτης Ιστού Firefox ESR -X-GNOME-FullName[es]=Navegador web Firefox ESR -X-GNOME-FullName[fa]=مرورگر اینترنتی Firefox ESR -X-GNOME-FullName[fi]=Firefox ESR-selain -X-GNOME-FullName[fr]=Navigateur Web Firefox ESR -X-GNOME-FullName[hu]=Firefox ESR webböngésző -X-GNOME-FullName[it]=Firefox ESR Browser Web -X-GNOME-FullName[ja]=Firefox ESR ウェブ・ブラウザ -X-GNOME-FullName[ko]=Firefox ESR 웹 브라우저 -X-GNOME-FullName[nb]=Firefox ESR Nettleser -X-GNOME-FullName[nl]=Firefox ESR webbrowser -X-GNOME-FullName[nn]=Firefox ESR Nettlesar -X-GNOME-FullName[no]=Firefox ESR Nettleser -X-GNOME-FullName[pl]=Przeglądarka WWW Firefox ESR -X-GNOME-FullName[pt]=Firefox ESR Navegador Web -X-GNOME-FullName[pt_BR]=Navegador Web Firefox ESR -X-GNOME-FullName[ru]=Интернет-браузер Firefox ESR -X-GNOME-FullName[sk]=Internetový prehliadač Firefox ESR -X-GNOME-FullName[sv]=Webbläsaren Firefox ESR -Exec=/usr/local/bin/immudex-run firefox-esr -Terminal=false -X-MultipleArgs=false -Type=Application -Icon=firefox-esr -Categories=Network;WebBrowser; -MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https; -StartupWMClass=firefox-esr -StartupNotify=true diff --git a/launchers/org.keepassxc.KeePassXC-immudex.desktop b/launchers/org.keepassxc.KeePassXC-immudex.desktop deleted file mode 100644 index b5e9887..0000000 --- a/launchers/org.keepassxc.KeePassXC-immudex.desktop +++ /dev/null @@ -1,51 +0,0 @@ -[Desktop Entry] -Name=KeePassXC (immudex) -GenericName=Password Manager -GenericName[ar]=مدير كلمات المرور -GenericName[bg]=Мениджър на пароли -GenericName[ca]=Gestor de contrasenyes -GenericName[cs]=Aplikace pro správu hesel -GenericName[da]=Adgangskodehåndtering -GenericName[de]=Passwortverwaltung -GenericName[es]=Gestor de contraseñas -GenericName[et]=Paroolihaldur -GenericName[fi]=Salasanamanageri -GenericName[fr]=Gestionnaire de mot de passe -GenericName[hu]=Jelszókezelő -GenericName[id]=Pengelola Sandi -GenericName[it]=Gestione password -GenericName[ja]=パスワードマネージャー -GenericName[ko]=암호 관리자 -GenericName[lt]=Slaptažodžių tvarkytuvė -GenericName[nb]=Passordhåndterer -GenericName[nl]=Wachtwoordbeheer -GenericName[pl]=Menedżer haseł -GenericName[pt_BR]=Gerenciador de Senhas -GenericName[pt]=Gestor de palavras-passe -GenericName[ro]=Manager de parole -GenericName[ru]=Менеджер паролей -GenericName[sk]=Správca hesiel -GenericName[sv]=Lösenordshanterare -GenericName[th]=แอพจัดการรหัสผ่าน -GenericName[tr]=Parola yöneticisi -GenericName[uk]=Розпорядник паролів -GenericName[zh_CN]=密码管理器 -GenericName[zh_TW]=密碼管理員 -Comment=Community-driven port of the Windows application “KeePass Password Safe” -Comment[da]=Fællesskabsdrevet port af Windows-programmet “KeePass Password Safe” -Comment[et]=Kogukonna arendatav port Windowsi programmist KeePass Password Safe -Comment[ru]=Разработанный сообществом порт Windows-приложения KeePass Password Safe -Exec=/usr/local/bin/immudex-run keepassxc -TryExec=/usr/local/bin/immudex-run keepassxc -Icon=keepassxc -StartupWMClass=keepassxc -StartupNotify=true -Terminal=false -Type=Application -Version=1.5 -Categories=Utility;Security;Qt; -MimeType=application/x-keepass2; -SingleMainWindow=true -X-GNOME-SingleWindow=true -Keywords=security;privacy;password-manager;yubikey;password;keepass; -Keywords[de]=sicherheit;privatsphäre;passwort-manager;yubikey;passwort;keepass; diff --git a/tools/bin/immudex-branch b/tools/bin/immudex-branch new file mode 100755 index 0000000..0c0c876 --- /dev/null +++ b/tools/bin/immudex-branch @@ -0,0 +1,47 @@ +#!/bin/bash + +function help() { + echo "immudex-branch it's a conky helper script, which returns Debian version"; + echo "used for build immudex. This information is used in 'Info:' section"; + echo "in conky widget as complement in name of immudex version."; + echo; + echo "Usage: immudex-branch [--help] [--version]"; + echo; + echo "Options:"; + echo " --help Print this message."; + echo " --version Print information about version, author and copyrights."; + echo; + echo "Examples:"; + echo " immudex-branch Prints version of Debian used for immudex build with hyphen on start of." + echo " immudex-branch --help Prints this message."; + echo " immudex-branch --version Print information about version, author and copyrights."; + echo; + echo "Report bugs to "; +} + +function version() { + echo "immudex-branch 1.0"; + echo; + echo "Copyright (C) 2026 morketsmerke.org"; + echo "This is free software; see the source for copying conditions. There is NO"; + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; + echo; + echo "Written by xf0r3m."; + +} + +if [ "$1" ]; then + if [ "$1" = "--help" ]; then + help; + elif [ "$1" = "--version" ]; then + version; + fi +else + if grep -q 'forky' /etc/os-release; then + echo -n '-testing'; + elif grep -q 'trixie' /etc/os-release; then + echo -n '-stable'; + else + echo -n '-oldstable'; + fi +fi diff --git a/tools/bin/immudex-cdrip b/tools/bin/immudex-cdrip new file mode 100755 index 0000000..8ef6186 --- /dev/null +++ b/tools/bin/immudex-cdrip @@ -0,0 +1,148 @@ +#!/bin/bash + +function XMLScrap() { + echo -n $(grep -o "<${1}>.*" $2 \ + | sed "s,<${1}>,," \ + | sed "s,,," \ + | sed 's,&,and,g'); +} + +function help() { + echo "immudex-cdrip it's a bash script for collect audio tracks from Audio CD's."; + echo "Script apart form ripping Audio CD's, reads metadata, check it on music"; + echo "databases and creates properly named directories and audio files."; + echo; + echo "Usage: immudex-cdrip [--rip-only] [--get-disc-info] [--rip-n-rename] [--help] [--version]"; + echo; + echo "Options:"; + echo " --rip-only Rips audio tracks from Audio CD, without quering CDIndex (MusicBrainz) database."; + echo " --get-disc-info Getting info from CDIndex (MusicBrainz) database about Audio CD without ripping."; + echo " --rip-n-rename Rips audio tracks from Audio CD, create Artist/Album folders and rename tracks according to data get CDIndex (MusicBrainz) database (normal usage)."; + echo " --help Print this message."; + echo " --version Print information about version, author and copyrights."; + echo; + echo "Examples:"; + echo " immudex-cdrip Print this message"; + echo " immudex-cdrip --get-disc-info Check is in MusicBrainz DB, are there any data about puted CD in drive."; + echo " Could be useful with less popular artists."; + echo " immudex-cdrip --rip-n-rename Rips Audio CD and names dirs and files with MusicBrainz data."; + echo; + echo "Report bugs to "; +} + +function version() { + echo "immudex-cdrip 1.0"; + echo; + echo "Copyright (C) 2026 morketsmerke.org"; + echo "This is free software; see the source for copying conditions. There is NO"; + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; + echo; + echo "Written by xf0r3m."; +} + +function multipleArtistDisc() { + + FILE="$1"; + ARTIST="VA"; + ALBUM=$(XMLScrap "Title" $FILE); + NUMTRACKS=$(XMLScrap "NumTracks" $FILE); + TRACKPATH="${ARTIST} - ${ALBUM}"; + + mkdir -vp "${TRACKPATH}"; + + i=1; + while [ $i -le $NUMTRACKS ]; do + artist=$(grep -o ".*" $FILE \ + | sed -n "${i}p" \ + | sed 's,,,' \ + | sed 's,,,'); + + trackName=$(grep -o ".*" $FILE \ + | sed -n "${i}p" \ + | sed 's,,,' \ + | sed 's,,,'); + + if [ $i -lt 10 ]; then + trackNumber="0${i}"; + else + trackNumber=${i}; + fi + + audioFilename="audio_${trackNumber}.wav"; + infFilename=$(echo $audioFilename | sed 's/wav/inf/'); + + mv -v $audioFilename "${TRACKPATH}/${trackNumber}. ${artist} - ${trackName}.wav"; + rm -v ${infFilename}; + i=$(expr $i + 1); + done + + rm -v audio.cddb; + rm -v ${FILE}; +} + +#if [ ! -x /usr/bin/cdda2wav ]; then +# exit 1; +#fi + +if [ "$1" ] && [ "$1" = "--rip-only" ]; then + cdda2wav -vall cddb=-1 speed=4 -paranoia paraopts=no-verify -B -D /dev/sr0; + exit 0; +fi + +if [ "$1" ] && [ "$1" = "--get-disc-info" ]; then + cdda2wav -J -D /dev/sr0; + exit 0; +fi + +if [ "$1" ] && [ "$1" = "--rip-n-rename" ]; then + cdda2wav -vall cddb=1 speed=4 -paranoia paraopts=no-verify -B -D /dev/sr0; + + FILE="audio.cdindex"; + + if $(grep -q '' $FILE); then + multipleArtistDisc $FILE; + else + ARTIST=$(XMLScrap "Artist" $FILE); + ALBUM=$(XMLScrap "Title" $FILE); + NUMTRACKS=$(XMLScrap "NumTracks" $FILE); + TRACKPATH="${ARTIST}/${ALBUM}"; + + mkdir -vp "${TRACKPATH}"; + + i=1; + while [ $i -le $NUMTRACKS ]; do + trackName=$(grep -o ".*" $FILE \ + | sed -n "${i}p" \ + | sed 's,,,' \ + | sed 's,,,'); + + if [ $i -lt 10 ]; then + audioFilename="audio_0${i}.wav"; + trackNumber="0${i}"; + else + audioFilename="audio_${i}.wav"; + trackNumber="${i}"; + fi + infFilename=$(echo "$audioFilename" | sed 's/wav/inf/'); + mv -v $audioFilename "${TRACKPATH}/${trackNumber}. ${ARTIST} - ${trackName}.wav"; + rm -v $infFilename; + i=$(expr $i + 1); + done + + rm -v audio.cddb; + rm -v audio.cdindex; + fi + exit 0; +fi + +if [ "$1" ] && [ "$1" = "--help" ]; then + help; + exit 0; +fi + +if [ "$1" ] && [ "$1" = "--version" ]; then + version; + exit 0; +fi + +help; diff --git a/tools/bin/immudex-import-gpgkeys b/tools/bin/immudex-import-gpgkeys new file mode 100755 index 0000000..89b6773 --- /dev/null +++ b/tools/bin/immudex-import-gpgkeys @@ -0,0 +1,46 @@ +#!/bin/bash + +function help() { + echo "it's a script for import GPG keys and owner trust. GPG keys can be used"; + echo "by 'pass' - POSIX compatibile password manager or signing. It's very"; + echo "helpful, when your keys are in files in encrypted datastore."; + echo "Script requires to store GPG keys in home dir or change home dir before"; + echo "execute a script."; + echo; + echo "Usage: immudex-import-gpgkeys [--help] [--version]"; + echo; + echo "Options:"; + echo " --help Print this message."; + echo " --version Print information about version, author and copyrights"; + echo; + echo "Examples:"; + echo " immudex-import-gpgkeys Import GPG keys and owner trust."; + echo " immudex-import-gpgkeys --help Print this message."; + echo " immudex-import-gpgkeys --version Print information about version, author and copyrights."; + echo; + echo "Report bugs to "; +} + +function version() { + echo "immudex-import-gpgkeys 1.0"; + echo; + echo "Copyright (C) 2026 morketsmerke.org"; + echo "This is free software; see the source for copying conditions. There is NO"; + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; + echo; + echo "Written by xf0r3m."; +} + +if [ "$1" ]; then + if [ "$1" = "--help" ]; then + help; + elif [ "$1" = "--version" ]; then + version; + fi +else + if [ -f ~/public.gpg ] && [ -f ~/private.gpg ] && [ -f ~/otrust.txt ]; then + gpg --import ~/public.gpg + gpg --import ~/private.gpg + gpg --import-ownertrust ~/otrust.txt + fi +fi diff --git a/tools/bin/immudex-import-sshkeys b/tools/bin/immudex-import-sshkeys new file mode 100755 index 0000000..91e1c2b --- /dev/null +++ b/tools/bin/immudex-import-sshkeys @@ -0,0 +1,63 @@ +#!/bin/bash + +function help() { + echo "it's a script for copying OpenSSH client files such as keys and config file into user native home directory."; + echo "This command should be run in other home directory, where ssh keys are stored."; + echo; + echo "Usage: immudex-import-sshkeys [--import-hosts] [--help] [--version]"; + echo; + echo "Options:"; + echo " --import-hosts Import hostnames and adresses to /etc/host file (sudo required) from SSH config file if exist."; + echo " --help Print this message."; + echo " --version Print information about version, author and copyrights."; + echo; + echo "Examples:"; + echo " immudex-import-sshkeys Import OpenSSH client files into user native home dir."; + echo " immudex-import-sshkeys --import-hosts Import OpenSSH client files and create DNS resolve database in /etc/hosts by taking data from OpenSSH client config file, if exist."; + echo " immudex-import-sshkeys --help Print this message."; + echo " immudex-import-sshkeys --version Print information about version, author and copyrights." + echo; + echo "Report bugs to "; +} + +function version() { + echo "immudex-import-sshkeys 1.0"; + echo; + echo "Copyright (C) 2026 morketsmerke.org"; + echo "This is free software; see the source for copying conditions. There is NO"; + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; + echo; + echo "Written by xf0r3m."; +} + +if [ "$1" ]; then + if [ "$1" = "--help" ]; then + help; + elif [ "$1" = "--version" ]; then + version; + fi +else +if $(ls $HOME | grep -q '.*_rsa.*'); then + if [ -d /home/$USER/.ssh ]; then + cp -v ~/*_rsa* /home/$USER/.ssh; + else + mkdir /home/$USER/.ssh; + chmod 700 /home/$USER/.ssh; + cp -v ~/*_rsa* /home/$USER/.ssh; + fi +fi +if $(ls -w1 $HOME | grep -q '^config$'); then + cp -v ~/config /home/$USER/.ssh; + if [ "$1" ] && [ "$1" = "--import-hosts" ]; then + i=1; + hostsCount=$(grep -o "Host .*" ~/config | wc -l); + while [ $i -le $hostsCount ]; do + host=$(grep -o "Host .*" ~/config | sed -n "${i}p" | awk '{printf $2}'); + hostName=$(grep -o "HostName .*" ~/config | sed -n "${i}p" | awk '{printf $2}'); + echo -e "${host}\t${hostName}" | sudo tee -a /etc/hosts; + i=$(expr $i + 1); + done + fi + chmod 600 /home/$USER/.ssh/config; +fi +fi diff --git a/tools/bin/immudex-meteo b/tools/bin/immudex-meteo new file mode 100755 index 0000000..9a0c6c0 --- /dev/null +++ b/tools/bin/immudex-meteo @@ -0,0 +1,47 @@ +#!/bin/bash + +function help() { + echo "immudex-meteo script fetching weather status from wttr.in webpage." + echo "The weather status is availabel to get in 3 formats described below"; + echo "in options."; + echo; + echo "Usage: immudex-meteo [--short | --long | --micro location] [--help] [--version]"; + echo; + echo "Options:"; + echo " --short location Short human readable format with one small ascii art."; + echo " --long location Long format, more readable, weather for every stage of the day and 2-day forecast"; + echo " --micro location Micro format, one line with details (current weather)"; + echo " --help Prints this message"; + echo " --version Prints information about version, author and copyrights"; + echo; + echo "Exmaples:"; + echo " immudex-meteo --short London Current weather in London in short format."; + echo " immudex-meteo --long Berlin Weather for whole day in Berlin and 2-day forecast."; + echo " immudex-meteo --micro Warszawa One line with weather information from Warsaw, good for motd's or resources monitors."; + echo; + echo "Report bugs to "; +} + +function version() { + echo "immudex-meteo 1.0"; + echo; + echo "Copyright (C) 2026 morketsmerke.org"; + echo "This is free software; see the source for copying conditions. There is NO"; + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; + echo; + echo "Written by xf0r3m."; +} + +if [ "$1" ]; then + case $1 in + "--short") curl wttr.in/${2}?format=2\&lang=pl;; + "--long") curl wttr.in/${2}?lang=pl;; + "--micro") curl wttr.in/${2}?format=4;; + "--help") help; exit 0;; + "--version") version; exit 0;; + *) help; exit 1;; + esac +else + help; + exit 1; +fi diff --git a/tools/bin/immudex-motd b/tools/bin/immudex-motd new file mode 100755 index 0000000..dcf1793 --- /dev/null +++ b/tools/bin/immudex-motd @@ -0,0 +1,107 @@ +#!/bin/bash + + +if [ "$1" ]; then + if [ "$1" = "--help" ]; then + echo "immudex-motd prints configurable message of the day."; + echo "Information and its quantity can be changed via the configuration file."; + echo "Script using figlet basic font and lolcat for print header of message."; + echo; + echo "Usage: immudex-motd [--help] [--version]"; + echo; + echo "Options:"; + echo " --help Print this message."; + echo " --version Print information about version, author and copyright"; + echo; + echo "Files:"; + echo " /etc/motd.conf Script configuration file."; + echo " /usr/share/doc/immudex-motd/motd.conf.sample Example configuration file."; + echo; + echo "Examples:"; + echo " immudex-motd Run a script."; + echo; + echo "Report bugs to "; + exit 0; + fi + if [ "$1" = "--version" ]; then + echo "immudex-motd 1.0"; + echo; + echo "Copyright (C) 2026 morketsmerke.org"; + echo "This is free software; see the source for copying conditions. There is NO"; + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; + echo; + echo "Written by xf0r3m."; + exit 0; + fi +fi + +if [ -f /etc/motd.conf ]; then + source /etc/motd.conf; +else + source /usr/share/doc/immudex-motd/motd.conf.sample; +fi + +echo -en "\e[1m"; echo "$(hostname)" | /usr/bin/figlet | lolcat; echo -en "\e[0m"; +echo; +echo "Today is: $(date)"; +echo; +echo "System summary: "; +cpuIdle=$(vmstat | tail -1 | awk '{printf $15}'); +cpuUsage=$((100 - $cpuIdle)); +echo -e " \tCPU: ${cpuUsage}%"; +echo -e " \tMEM: $(free -h | sed -n '2p' | awk '{printf $7}' | sed 's/i//') Free"; +if [ "$MOUNT_POINTS" ]; then + echo -e " \tMount points:\tFree/Total\t(Usage%)"; + for mountPoint in $MOUNT_POINTS; do + if $(df -h 2>/dev/null | grep -q "${mountPoint}"); then + diskSize=$(df -h 2> /dev/null | grep "${mountPoint}" | awk '{printf $2}'); + diskFree=$(df -h 2> /dev/null | grep "${mountPoint}" | awk '{printf $4}'); + diskUsage_perc=$(df -h 2> /dev/null | grep "${mountPoint}" | sed 's/%//' | awk '{printf $5}'); + echo -e "\t$(echo $mountPoint | sed 's,\$,,'):\t\t${diskFree}/${diskSize}\t(${diskUsage_perc}%)"; + fi + done +fi +if $(echo $OPTIONS | grep -q 'cryptparts'); then + if $(df -h 2> /dev/null | grep -q '/dev/mapper'); then + i=1; + echo -e " \tCRYPT_PARTi: Free/Total (Usage%)"; + amountOfDisks=$(df -h 2> /dev/null | grep '/dev/mapper' | wc -l | awk '{printf $1}'); + while [ $i -le $amountOfDisks ]; do + diskSize=$(df -h 2> /dev/null | grep '/dev/mapper' | sed -n "${i}p" | awk '{printf $2}'); + diskFree=$(df -h 2> /dev/null | grep '/dev/mapper' | sed -n "${i}p" | awk '{printf $4}'); + diskUsage_perc=$(df -h 2> /dev/null | grep '/dev/mapper' | sed -n "${i}p" | sed 's/%//' | awk '{printf $5}'); + #FCP = First Crypt Partition + echo -e " \tCRYPT_PART${i}: ${diskFree}/${diskSize} (${diskUsage_perc}%)"; + i=$((i + 1)); + done + else + echo -e " \tCRYPT_PART: N/A"; + fi +fi +echo -e " \tIP: $(ip addr show $(sed -n '2p' /proc/net/route | awk '{printf $1}') | grep 'inet\ ' | awk '{printf $2"\n"}')"; +echo -e " \tPROCESSES: $(ps -aux | wc -l | awk '{printf $1}')"; +if $(uptime | grep -q 'day'); then + utime=$(uptime | awk '{printf $3" "$4" "$5}' | sed -e 's/\,$//' -e 's,:,h ,'); + echo -e "\tUPTIME: ${utime}m"; +else + utime=$(uptime | awk '{printf $3}' | sed -e 's/,//' -e 's,:,h ,'); + if $(echo $utime | grep -q "h"); then + echo -e " \tUPTIME: ${utime}m"; + else + echo -e " \tUPTIME: 0h ${utime}m"; + fi +fi +echo -e " \t$(uptime | grep -o "load.*$" | tr [a-z] [A-Z])"; +echo; +if [ -x /usr/bin/immudex-meteo ]; then +echo "Weather:"; + if [ "$LOCATION" ]; then + /usr/bin/immudex-meteo --micro $LOCATION; + fi +fi +echo; +if [ "$FOOTER" ]; then + echo -e "$FOOTER"; +fi +echo; +echo "===================================================================="; diff --git a/tools/bin/immudex-padlock b/tools/bin/immudex-padlock new file mode 100755 index 0000000..92e6446 --- /dev/null +++ b/tools/bin/immudex-padlock @@ -0,0 +1,120 @@ +#!/bin/bash + +function help(){ + echo "it's a switch script. This script, if there is more than one cryptdisk"; + echo "gives a change to choose a cryptdisk and starts opening him. After"; + echo "sucessful opening, it spawns a terminal window with CWD sets up on"; + echo "choosed cryptdisk mountpoint and change the launcher icon in the bottom"; + echo "panel, which informs user, there are a opened cryptdisks. When user,"; + echo "execute script once again, he close all opened cryptdisk either that"; + echo "not open with this script. At least he tries. In some cases it will be"; + echo "impossible, because there are processes which using this cryptdisk or"; + echo "inside this mount point there is other mount point. This is signaled,"; + echo "by apropriate notification."; + echo "This script needs superuser (root) privileges, but using sudo command"; + echo "is implemented inside the script, you don't needed to launch this"; + echo "via sudo."; + echo; + echo "Usage: immudex-padlock [--help] [--version]"; + echo; + echo "Example:"; + echo " immudex-padlock Standard script execution, explained above."; + echo " immudex-padlock --help Print this message."; + echo " immudex-padlock --version Print information about version, author and copyrights."; + echo; + echo "Files:"; + echo " /usr/share/icons/padlock-icon.png Symlink, original launcher icon."; + echo " /usr/share/icons/changes-prevent.png Original, closed padlock icon."; + echo " /usr/share/icons/changes-allow.png Original, open padlock icon."; + echo " /etc/skel/.config/xfce4/panel/launcher-14/16844255236.desktop XFCE4 bottom panel script activator."; + echo; + echo "Report bugs to "; +} + +function version(){ + echo "immudex-padlock 1.0"; + echo; + echo "Copyright (C) 2026 morketsmerke.org"; + echo "This is free software; see the source for copying conditions. There is NO"; + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; + echo; + echo "Written by xf0r3m."; +} + +launcher="/home/${USER}/.config/xfce4/panel/launcher-14/16844255236.desktop"; + +function main_unlock() { + sudo /usr/local/sbin/immudex-crypt --open=$1; + index=$(basename $(sudo /usr/local/sbin/immudex-crypt --list | grep "$1" | head -1 | awk '{printf $2}' | grep -o '[0-9]')); + #sudo mkdir -p /media/${USER}/$devName; + #sudo mount /dev/mapper/$devName /media/${USER}/$devName; + + xfce4-terminal --default-working-directory=/ic${index}; + sed -i 's/padlock-icon/changes-allow/' ${launcher}; + #sudo rm /usr/share/icons/padlock-icon.png; + #sudo ln -s /usr/share/icons/changes-allow.png /usr/share/icons/padlock-icon.png; + +} + +function unlock() { + + cryptParts=$(sudo blkid | grep 'LUKS' | sed 's/://g' | awk '{printf $1" "}'); + if [ "$cryptParts" ]; then + if [ $(echo $cryptParts | wc -w) -gt 1 ]; then + select cryptPart in $cryptParts; do + main_unlock $cryptPart; + break; + done + else + main_unlock $cryptParts; + fi + else + echo -e "\e[31mThere is no LUKS partition to open.\e[0m"; + sleep 3; + fi +} + +function lock() { + + mapperDeviceList=$(ls /dev/mapper | grep 'immudex-*' | awk '{printf $1" "}'); + + if [ "$mapperDeviceList" ]; then + for dmDevice in $mapperDeviceList; do + if sudo cryptsetup status /dev/mapper/${dmDevice} > /dev/null 2>&1; then + mountPoint=$(df --output=source,target /dev/mapper/${dmDevice} | tail -n 1 | awk '{printf $2}'); + if [ "$mountPoint" ]; then + if $(sudo lsof $mountPoint > /dev/null 2>&1); then + notify-send "Padlock" "The /dev/mapper/${dmDevice} cannot be unmount, because there are opened file or running proceses." --icon=dialog-error; + else + sudo umount $mountPoint; + if [ $? -ne 0 ]; then + notify-send "Padlock" "The /dev/mapper/${dmDevice} cannot be unmount, because there are other filesystem is mounted in." --icon=dialog-error; + fi + sudo cryptsetup close /dev/mapper/${dmDevice}; + fi + else + sudo cryptsetup close /dev/mapper/${dmDevice}; + fi + fi + done + fi + if ! $(df -h | grep -q '/dev/mapper'); then + sed -i 's/changes-allow/padlock-icon/' ${launcher}; + #sudo rm /usr/share/icons/padlock-icon.png; + #sudo ln -s /usr/share/icons/changes-prevent.png /usr/share/icons/padlock-icon.png; + fi +} + +if [ "$1" ]; then + if [ "$1" = "--help" ]; then + help; + elif [ "$1" = "--version" ]; then + version; + fi +else + mapperDeviceList=$(ls /dev/mapper | grep 'immudex-*' | awk '{printf $1" "}'); + + if [ "$mapperDeviceList" ]; then lock; + else unlock; + fi +fi diff --git a/tools/bin/immudex-pl b/tools/bin/immudex-pl new file mode 100755 index 0000000..fa9e196 --- /dev/null +++ b/tools/bin/immudex-pl @@ -0,0 +1,140 @@ +#!/bin/bash + +GREEN="\e[32m"; +RED="\e[31m"; +ENDCOLOR="\e[0m"; +SYSTEM_CC=$(echo $LANG | cut -c 1-2); + +function help() { + echo "immudex-pl opening (play) links. Script creates menu from link list, which"; + echo "can be open via mpv (with yt-dlp hook). Normally links are open as"; + echo "audio stream. Script work in loop, which means you can change playback"; + echo "while the current one is still playing. When you need to exit type any letter instead of number."; + echo "Script is not only for YouTube Links, it can also open"; + echo "internet radios or shoutcasts. The link list can be downloaded and does"; + echo "not need to be stored on the target device. Script will delete the"; + echo "file at the end of its execution. "; + echo; + echo "Usage: immudex-pl [--video --format=240p...1080p] [--help] [--version] link-list"; + echo; + echo "Options:"; + echo " --video --format=240p...1080p Open link as video."; + echo " --help Print this message."; + echo " --version Print information about version, author and copyrights."; + echo; + echo "Files:"; + echo " /usr/share/doc/immudex-pl/links.list.example Example link list file."; + echo; + echo "Examples:" + echo " immudex-pl ~/radio-links.txt Open given link list as audio stream."; + echo " immudex-pl --video --format=360p ./yt-links Open given link list as video in 360p format."; + echo; + echo "Report bugs to "; +} + +function version() { + echo "immudex-pl 1.0"; + echo; + echo "Copyright (C) 2026 morketsmerke.org"; + echo "This is free software; see the source for copying conditions. There is NO"; + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; + echo; + echo "Written by xf0r3m."; +} + +if [ "$1" ] && [ $1 = "--video" ]; then + video=1; + shift; + if $(echo $1 | grep -q '\-\-format'); then + format=$(echo $1 | grep -o '[0-9]' | awk '{printf $1}') + fi + shift; + file=$1; +elif [ "$1" ] && [ $1 = "--help" ]; then + help; + exit 0; +elif [ "$1" ] && [ $1 = "--version" ]; then + version; + exit 0; +else + file=$1; +fi + + +if echo $file | grep -q 'http'; then + echo -n "Getting link list..."; + wget -q $file -O /tmp/playlist.txt; + if [ $? -eq 0 ]; then + echo -e "[ ${GREEN}OK${ENDCOLOR} ]"; + file="/tmp/playlist.txt"; + else + echo -e "[ ${RED}FAIL${ENDCOLOR} ]"; + help; + exit 1; + fi +fi + +if [ "$file" ]; then + PS3="Link: "; + linkNames=$(cut -d ":" -f 1 $file | sed 's/\ /_/g' | awk '{printf $1" "}') + select name in $linkNames; do + if [ "$MPVPID" ]; then kill $MPVPID; fi + if [ ! "$name" ]; then break; fi + link=$(grep "$name" $file | cut -d ":" -f 2-3); + if [ ! "$link" ]; then + linkName=$(echo $name | sed 's/_/\ /g'); + link=$(grep "$linkName" $file | cut -d ":" -f 2-3); + fi + if echo $link | grep -q "youtube"; then + link=$(echo $link | sed 's/\ //g'); + if [ "$video" ]; then + #ytplay -v $link -f $format + #format="--ytdl-format=$(grep "$link" $file | cut -d ":" -f 4-)"; + echo "Getting requested video format ID..."; + video=$(yt-dlp --list-formats $link 2>/dev/null | grep "$format" | sed -n '1p' | awk '{printf $1}') + if [ ! "$video" ]; then + echo -e "Getting requested video format ID...[ ${RED}FAILED${ENDCOLOR} ]"; + exit 1; + else + echo -e "Getting requested video format ID...[ ${GREEN}OK${ENDCOLOR} ]"; + fi + + echo "Getting appropiate audio format ID for video..."; + audio=$(yt-dlp --list-formats $link 2>/dev/null | grep 'audio only' | grep "$SYSTEM_CC" | sed -n '1p' | awk '{printf $1}'); + if [ ! "$audio" ]; then + echo -e "Getting audio format based on your locales...[ ${RED}FAILED${ENDCOLOR} ]"; + echo "Getting high quality audio stream format..."; + audio=$(yt-dlp --list-formats $link 2>/dev/null | grep 'audio only' | grep "high" | sed -n '1p' | awk '{printf $1}'); + if [ ! "$audio" ]; then + echo "No audio stream found...[ ${RED}DEAD${ENDCOLOR} ]"; + exit 1; + else + echo -e "Getting high quality audio stream format...[ ${GREEN}OK${ENDCOLOR} ]"; + fi + else + echo -e "Getting audio format based on your locales...[ ${GREEN}OK${ENDCOLOR} ]"; + fi + fmat="--ytdl-format=${video}+${audio}"; + echo "MPV is starting up..."; + mpv $fmat $link > /dev/null 2>&1 & MPVPID=$! + + else + #ytplay -a $link -f best[height=360] + format="--no-video"; + echo "MPV is starting up..."; + mpv $format $link > /dev/null 2>&1 & MPVPID=$! + fi + else + mpv --no-video $link > /tmp/pl.log 2>&1 & MPVPID=$!; + tail -f /tmp/pl.log | grep "icy-title" & + fi + #echo "MPV: $MPVPID"; + done +else + help; + exit 1; +fi + +if [ -f /tmp/playlist.txt ]; then + rm /tmp/playlist.txt; +fi diff --git a/tools/bin/immudex-run b/tools/bin/immudex-run new file mode 100755 index 0000000..c0fa3e4 --- /dev/null +++ b/tools/bin/immudex-run @@ -0,0 +1,51 @@ +#!/bin/bash + +function help() { + echo "This script allows to run a program with pointed home dir on first"; + echo "opened LUKS partition via immudex-crypt tool. The most programs in"; + echo "Linux write some data in users home dirs. Doing this persistentaly"; + echo "in immudex is imposible, because all default users home dirs came back"; + echo "to state from image and wroted date are gone. Running programs via this"; + echo "scripts makes possible to save this date on first 'crypt'."; + echo "This script can be use to make your own activators easlly."; + echo; + echo "Usage: immudex-run [--help] [--version] program_name [program_args]"; + echo; + echo "Examples:"; + echo " immudex-run firefox-esr Run given program"; + echo " immudex-run --help Print this message"; + echo " immudex-run --version Print information about version, author and copyrights"; + echo; + echo "Report bugs to "; +} + +function version(){ + echo "immudex-run 1.0"; + echo; + echo "Copyright (C) 2026 morketsmerke.org"; + echo "This is free software; see the source for copying conditions. There is NO"; + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; + echo; + echo "Written by xf0r3m."; +} + +if [ "$1" ]; then + if [ "$1" = "--help" ]; then + help; + exit 0; + elif [ "$1" = "--version" ]; then + version; + exit 0; + fi +fi + +export HOME=/ic0; +export XDG_CONFIG_HOME=/ic0; +export XDG_CACHE_HOME=/ic0/.cache; +export XDG_CONFIG_DIRS=/ic0/.config; + +program=$1; +shift; +args="$@"; + +$(which $program) ${args}; diff --git a/tools/bin/immudex-secured-firefox b/tools/bin/immudex-secured-firefox new file mode 100755 index 0000000..32720aa --- /dev/null +++ b/tools/bin/immudex-secured-firefox @@ -0,0 +1,43 @@ +#!/bin/bash + +function help() { + echo "This tool running up a Firefox browser via firejail with sandboxing "; + echo "and forcing network interface to that we use to internet connection."; + echo; + echo "Usage: immudex-secured-firefox [--help] [--version]"; + echo; + echo "Exaples:"; + echo " immudex-secured-firefox Run secured browser."; + echo " immudex-secured-firefox --help Print this message."; + echo " immudex-secured-firefox --version Print information about version, author and copyrights"; + echo; + echo "Report bugs to "; +} + +function version(){ + echo "immudex-secured-firefox 1.0"; + echo; + echo "Copyright (C) 2026 morketsmerke.org"; + echo "This is free software; see the source for copying conditions. There is NO"; + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; + echo; + echo "Written by xf0r3m."; +} + +if [ "$1" ]; then + if [ "$1" = "--help" ]; then + help; + exit 0; + elif [ "$1" = "--version" ]; then + version; + exit 0; + fi +fi + +if [ ! -d /tmp/${USER} ]; then + mkdir /tmp/${USER} + cp -prvv /home/${USER}/.mozilla /tmp/${USER} +fi + +eth0=$(ip route show | grep 'default' | awk '{printf $5}'); +firejail --private=/tmp/${USER} --net=$eth0 /usr/lib/firefox-esr/firefox-esr diff --git a/tools/bin/immudex-secured-librewolf b/tools/bin/immudex-secured-librewolf new file mode 100755 index 0000000..30d65ee --- /dev/null +++ b/tools/bin/immudex-secured-librewolf @@ -0,0 +1,44 @@ +#!/bin/bash + +function help() { + echo "immudex-secured-librewolf, support for LibreWolf version. LibreWolf isn't"; + echo "part of immudex, but this tool officialy existed as a part of project."; + echo; + echo "Usage: immudex-secured-librewolf [--help] [--version]"; + echo; + echo "Examples:"; + echo " immudex-secured-librewolf Run sandboxed LibreWolf browser." + echo " immudex-secured-librewolf --help Print this messages." + echo " immudex-secured-librewolf --version Print information about version, author and copyrights."; + echo; + echo "Report bugs to "; +} + +function version(){ + echo "immudex-secured-librewolf 1.0"; + echo; + echo "Copyright (C) 2026 morketsmerke.org"; + echo "This is free software; see the source for copying conditions. There is NO"; + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; + echo; + echo "Written by xf0r3m."; +} + +if [ "$1" ]; then + if [ "$1" = "--help" ]; then + help; + exit; + elif [ "$1" = "--version" ]; then + version; + exit; + fi +fi + + +if [ ! -d /tmp/${USER} ]; then + mkdir /tmp/${USER} + cp -prvv /home/${USER}/.librewolf /tmp/${USER} +fi + +eth0=$(ip route show | grep 'default' | awk '{printf $5}'); +firejail --private=/tmp/${USER} --net=$eth0 /usr/bin/librewolf diff --git a/tools/bin/immudex-shoutcasts b/tools/bin/immudex-shoutcasts new file mode 100755 index 0000000..3c33211 --- /dev/null +++ b/tools/bin/immudex-shoutcasts @@ -0,0 +1,162 @@ +#!/bin/bash + +GREEN="\e[32m"; +RED="\e[31m"; +ENDCOLOR="\e[0m"; +BOLD="\e[1m"; +BOLD_GREEN="\e[1;32m"; +BOLD_YELLOW="\e[1;33m"; +BOLD_BLUE="\e[1;34m"; + +function help() { + echo "immudex-shoutcasts script that search internet radios or shoutcasts in two sources xiph.org icecast"; + echo "directory and download .m3u file from radio-browser.info based on a space-separated keywords."; + echo "Data from radio-browser.info are limited to 30 results."; + echo; + echo "Usage: immudex-shoutcasts [--source=icecast | radio] [--help] [--version] --keywords=keyword1...keywordN"; + echo; + echo "Options:"; + echo " --source=icecast/radio This parameter specifies source, if we want define a source. It can be omitted, then both sources will be searched."; + echo " --keywords=keyword1...keywordsN This parameter is required, it pass keywords to search. Keywords are space-separated."; + echo " --help Print this message."; + echo " --version Print information about version, author and copyrights."; + echo; + echo "Examples:"; + echo " immudex-shoutcasts --keywords=Classic Rock Script will be search internet radios and shoutcast for 'Classic Rock' keywords"; + echo " immudex-shoutcasts --source=radio --keywords=lofi Script will be search internet radios (because source is given) for 'lofi' keyword"; + echo; + echo "Files:" + echo " /tmp/icecast.idx Temporary file, store search results from icecast directory for parsing."; + echo " /tmp/radio.idx Temporary file, downloaded .m3u file from radio-browser.info store search results for parsing."; + echo; + echo "Report bugs to "; +} + +function version() { + echo "immudex-shoutcasts 1.0"; + echo; + echo "Copyright (C) 2026 morketsmerke.org"; + echo "This is free software; see the source for copying conditions. There is NO"; + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; + echo; + echo "Written by xf0r3m."; +} + + +function getDataBetweenHtmlMarks() { + grep "$1" $2 | sed -n "${3}p" | cut -d ">" -f 2 | cut -d "<" -f 1; +} + +function listOfStations() { + query=$1; + src=$2; + + case $src in + "icecast") wget http://dir.xiph.org/search?q=$query -O /tmp/icecast.idx >> /dev/null 2>&1; + file="/tmp/icecast.idx";; + "radio") wget "https://de1.api.radio-browser.info/m3u/stations/search?limit=30&name=${query}&hidebroken=true&order=clickcount&reverse=true" -O /tmp/radio.idx >> /dev/null 2>&1; + file="/tmp/radio.idx"; + dos2unix $file; + esac + + if [ ! -f $file ]; then + echo -e "${RED}There is no internet connection or sources are currently"; + echo -e "unavailable.${ENDCOLOR}"; + exit 1; + fi + + case $src in + "icecast") amountOfStations=$(grep 'card-title' $file | wc -l);; + "radio") amountOfStations=$(grep '#EXTINF' $file | wc -l);; + esac + + case $src in + "icecast") echo -e "${BOLD}Icecast directory:${ENDCOLOR}";; + "radio") echo -e "${BOLD}radio-browser.info:${ENDCOLOR}";; + esac + + i=1; + while [ $i -le $amountOfStations ]; do + case $src in + "icecast") stationName=$(getDataBetweenHtmlMarks 'card-title' $file $i);; + "radio") stationName=$(grep '#EXTINF' $file | sed -n "${i}p" | cut -d "," -f 2-);; + esac + if [ "$src" = "icecast" ]; then + whatIsPlayingNow=$(getDataBetweenHtmlMarks 'card-subtitle' $file $i); + fi + case $src in + "icecast") link=$(grep 'Play' $file | sed -n "${i}p" | cut -d '"' -f 2);; + "radio") link=$(grep '://' $file | sed -n "${i}p");; + esac + echo -e "${BOLD}${i}.${ENDCOLOR} ${BOLD_YELLOW}${stationName}${ENDCOLOR}"; + if [ "$whatIsPlayingNow" ]; then + echo -e "\t${BOLD}Now playing:${ENDCOLOR} ${BOLD_BLUE}${whatIsPlayingNow}${ENDCOLOR}"; + unset whatIsPlayingNow; + fi + echo -e "\t${BOLD}Link:${ENDCOLOR} ${BOLD_GREEN}${link}${ENDCOLOR}"; + i=$(expr $i + 1); + done + unset i; + echo; +} + +if [ "$1" ]; then + + if [ "$1" ] && [ "$1" = "--help" ]; then + help; + exit 0; + elif [ "$1" ] && [ "$1" = "--version" ]; then + version; + exit 0; + fi + + option=$(echo $1 | cut -d '=' -f 1); + if [ "$option" = "--source" ]; then + src=$(echo $1 | cut -d '=' -f 2); + search=$(echo $* | cut -d '=' -f 3-); + elif [ "$option" = "--keywords" ]; then + search=$(echo $* | cut -d "=" -f 2-); + fi +else + help; + exit 1; +fi + +if [ "$src" ]; then + listOfStations "$search" $src; + if [ "$src" = "icecast" ]; then + file="/tmp/icecast.idx"; + else + file="/tmp/radio.idx"; + fi +else + listOfStations "$search" 'icecast'; + listOfStations "$search" 'radio'; + + PS3="source? "; + select src in 'icecast' 'radio'; do + case $src in + 'icecast') file="/tmp/icecast.idx";; + 'radio') file="/tmp/radio.idx";; + *) exit 0; + esac + break + done +fi + +echo -n "Station? "; +read station; +if $(echo $station | grep -q '[0-9]') && [ $station -le 30 ]; then + case $file in + '/tmp/icecast.idx') link=$(grep 'Play' $file | sed -n "${station}p" | cut -d '"' -f 2);; + '/tmp/radio.idx') link=$(grep '://' $file | sed -n "${station}p");; + esac + case $src in + "icecast") stationName=$(getDataBetweenHtmlMarks 'card-title' $file $station);; + "radio") stationName=$(grep '#EXTINF' $file | sed -n "${station}p" | cut -d "," -f 2-);; + esac + echo -e "${BOLD}Station:${ENDCOLOR} ${BOLD_YELLOW}${stationName}${ENDCOLOR}"; + mpv --no-video $link; +else + exit 0; +fi diff --git a/tools/bin/immudex-version b/tools/bin/immudex-version new file mode 100755 index 0000000..9c663f7 --- /dev/null +++ b/tools/bin/immudex-version @@ -0,0 +1,39 @@ +#!/bin/bash + +function help() { + echo "Script returns first 7 signs of immudex commit ID."; + echo; + echo "Usage: immudex-version [--help] [--version]"; + echo; + echo "Options:"; + echo " --help Print this message."; + echo " --version Print information about version, author and copyrights."; + echo; + echo "Files:"; + echo " /run/live/medium/live/changelog Stores information about currently running immudex image."; + echo; + echo "Report bugs to "; +} + +function version(){ + echo "immudex-version 1.0"; + echo; + echo "Copyright (C) 2026 morketsmerke.org"; + echo "This is free software; see the source for copying conditions. There is NO"; + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; + echo; + echo "Written by xf0r3m."; +} + +if [ "$1" ]; then + if [ "$1" = "--help" ]; then + help; + exit 0; + elif [ "$1" = "--version" ]; then + version; + exit 0; + fi +fi + +eval $(grep '^COMMIT' /run/live/medium/live/changelog) +echo $COMMIT | awk '{printf $1}' | cut -c 1-7 diff --git a/tools/bin/immudex-ytplay b/tools/bin/immudex-ytplay new file mode 100755 index 0000000..4634065 --- /dev/null +++ b/tools/bin/immudex-ytplay @@ -0,0 +1,131 @@ +#!/usr/bin/env python3 + +import sys +import subprocess +import re +from youtube_search import YoutubeSearch + +def usage(): + + print('''immudex-ytplay script for playing a video or audio track from YouTube. Script +can search based on given keywords and return list of results. User choose +one of result or repeats searching with 'r' || 'R' answer to number from +list result. Then script quering YouTube for available formats and table +with possible format are printed. User have to put video and audio quality +from table in requested format: videoQualityID+audioQualityID. There are +a hint. Script is half-interactive. + +Usage: immudex-ytplay [--search='keyword1...keywordN' --video | --audio] [--video youtube_link] [--audio youtube_link] [--help] [--version] + +Options: + --search='keyword1...keywordN' --video/--audio Search given keywords on YouTube and play video or audiotrack. + --video YouTube_Link Play YouTube video. + --audio YouTube_Link Play only YouTube video audiotrack. + --help Print this message. + --version Print information about version, author and copyrights. + +Examples: + immudex-ytplay --search='lofi' --audio Script will be search a lofi keyword in YouTube and play only audio tracks from choosen video. + immudex-ytplay --video https://youtube.com/watch?v=... Script will be play a video from given link, of course is publicly available. + immudex-ytplay --audio https://youtube.com/watch?v=... Script will be play a audio track from given video link. The principle of video playback also applies here. + +Report bugs to ''') + +def version(): + print('''immudex-ytplay 1.0 + +Copyright (C) 2026 morketsmerke.org +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +Written by xf0r3m.''') + +def ytSearch(keywords, maxResults=15): + + i = "r" + while isinstance(i, str) and (i == "r" or i == "R"): + subprocess.run('clear') + results = YoutubeSearch(keywords, max_results=maxResults).to_dict() + + index = 1 + for video in results: + print(f"\033[1m\033[91m{index}\033[0m. Title: \033[92m{video['title']}\033[0m") + print(f" Channel: \033[93m{video['channel']}\033[0m, Duration: \033[94m{video['duration']}\033[0m, PubDate: \033[95m{video['publish_time']}\033[0m") + index += 1 + + i = input("Put number of video you wanna watch or put 'r' | 'R' to reload search result or send any other key to quit: ") + if isinstance(i, str) and i != 'r' and i != 'R' and not re.search("[0-9]+", i): + sys.exit(0) + + i = int(i) - 1 + return(results[i]['id'], results[i]['title'], results[i]['channel'], results[i]['duration'], results[i]['publish_time']) + +def getFormat(videoID): + subprocess.run(['yt-dlp', '--list-formats', 'https://youtube.com/watch?v=' + videoID]) + f = input("Please choose youtube video format, you need put video+audio ID of quality in this format or type anything else to quit:") + if not re.search("[0-9]{3}\+[0-9]{3}|[0-9]{2}", f): + sys.exit(0) + else: + return f + +if len(sys.argv) == 2: + if sys.argv[1] == '--help': + usage() + sys.exit(0) + elif sys.argv[1] == '--version': + version() + sys.exit(0) + +if len(sys.argv) < 2: + usage() + sys.exit(2) + +option=sys.argv[1].split("=", 1)[0] + +if option == '--search': + if len(sys.argv) > 2: + if sys.argv[2] == '--video': + mode = "video" + elif sys.argv[2] == '--audio': + mode = "audio" + else: + usage() + sys.exit(2) + keywords = sys.argv[1].split("=", 1)[1] + + video = ytSearch(keywords) + subprocess.run('clear') + + if mode == 'audio': + ytFormat = "--no-video" + else: + ytFormat = "--ytdl-format=" + getFormat(video[0]) + + subprocess.run('clear') + print(f"\033[91m1\033[0m. Title: \033[92m{video[1]}\033[0m") + print(f" Channel: \033[93m{video[2]}\033[0m, Duration: \033[94m{video[3]}\033[0m, PubDate: \033[95m{video[4]}\033[0m") + print("===================================================================") + + subprocess.run(['mpv', ytFormat, 'https://youtube.com/watch?v=' + video[0]]) + else: + usage() + sys.exit(2) + +elif sys.argv[1] == '--audio': + if len(sys.argv) > 2: + link=sys.argv[2] + ytFormat="--no-video" + subprocess.run(['mpv', ytFormat, link]) + else: + usage() + sys.exit(2) + +elif sys.argv[1] == '--video': + if len(sys.argv) > 2: + link=sys.argv[2] + videoID=link[-11:] + ytFormat="--ytdl-format=" + getFormat(videoID) + subprocess.run(['mpv', ytFormat, link]) + else: + usage() + sys.exit(2) diff --git a/tools/bin/library.sh b/tools/bin/library.sh new file mode 100755 index 0000000..1ba9ed8 --- /dev/null +++ b/tools/bin/library.sh @@ -0,0 +1,100 @@ +#!/bin/bash + + +#function help() { +# echo "This script does noting. It's a collection of functions uses by"; +# echo "other tools, by import this file into it self. Man page for this script"; +# echo "can be usefull for describe above mentioned functions."; +# echo; +# echo "Notes:"; +# echo -e " get_debian_branch() Can be used for convert Debian codename for Debian branch name\n"; +# echo -e " get_machine_arch() Used for getting information is this 32 or 64-bit architecture.\n"; +# echo -e " check_distro_commit() Is used for decide that you use a latest version immudex if there are commit ahead your image, this script returns 0, otherwise 1.\n"; +# echo -e " ascii_colors() Prints immudex name in ASCII manuali.\n"; +# echo; +# echo "Usage: source /usr/local/bin/library.sh"; +# echo; +# echo "Options:"; +# echo " There is no options... Function help and version are used only for generate man page file and will be comment out after this."; +# echo; +# echo "Report bugs to "; +#} + +#function version(){ +# echo "library.sh 1.0"; +# echo; +# echo "Copyright (C) 2026 morketsmerke.org"; +# echo "This is free software; see the source for copying conditions. There is NO"; +# echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; +# echo; +# echo "Written by xf0r3m."; +#} + + +function get_debian_branch() { + if grep -q 'trixie' /etc/os-release; then + echo "testing"; + elif grep -q 'bookworm' /etc/os-release; then + echo "stable"; + else + echo "oldstable"; + fi +} + +function get_machine_arch() { + arch=$(uname -m); + if [ "$arch" = "i686" ]; then + echo "32"; + else + echo "64"; + fi +} + +function check_distro_commit() { + versionFile="/run/live/medium/live/version"; + if [ -f $versionFile ]; then + localVersion=$(cat $versionFile); + if [ -d /tmp/immudex ]; then + $(cd /tmp/immudex && git pull -q); + else + git clone -q https://github.com/xf0r3m/immudex /tmp/immudex; + fi + latestVersion=$(cd /tmp/immudex && git log --pretty=oneline | head -1 | cut -d " " -f 1); + if [ "$1" ] && [ "$1" == "--print" ]; then + echo "$(cd /tmp/immudex && git log ${localVersion}..${latestVersion})"; + fi + if [ "$localVersion" = "$latestVersion" ]; then + return 0; + else + return 1; + fi + else + return 255; + fi +} + +function ascii_colors() { + + BLUE="\e[1;94m"; + RED="\e[1;91m"; + CYAN="\e[1;96m"; + ENDCOLOR="\e[0m"; + + echo -e "${BLUE} _ ${RED} _ ${CYAN} ${ENDCOLOR}"; + echo -e "${BLUE}(_)_ __ ___ _ __ ___ _ _ ${RED} __| | ___${CYAN}__ __${ENDCOLOR}"; + echo -e "${BLUE}| | '_ \` _ \| '_ \` _ \| | | |${RED}/ _\` |/ _ \\\\${CYAN} \/ /${ENDCOLOR}"; + echo -e "${BLUE}| | | | | | | | | | | | |_| |${RED} (_| | __/${CYAN}> < ${ENDCOLOR}"; + echo -e "${BLUE}|_|_| |_| |_|_| |_| |_|\__,_|${RED}\__,_|\___/${CYAN}_/\_\\"; + echo -e "${ENDCOLOR}"; + +} + +#if [ "$1" ]; then +# if [ "$1" = "--help" ]; then +# help; +# exit 0; +# elif [ "$1" = "--version" ]; then +# version; +# exit 0; +# fi +#fi diff --git a/tools/man/immudex-branch.1.gz b/tools/man/immudex-branch.1.gz new file mode 100644 index 0000000..57ac8d4 Binary files /dev/null and b/tools/man/immudex-branch.1.gz differ diff --git a/tools/man/immudex-cdrip.1.gz b/tools/man/immudex-cdrip.1.gz new file mode 100644 index 0000000..cd271c6 Binary files /dev/null and b/tools/man/immudex-cdrip.1.gz differ diff --git a/tools/man/immudex-create-media.1.gz b/tools/man/immudex-create-media.1.gz new file mode 100644 index 0000000..6f2a0eb Binary files /dev/null and b/tools/man/immudex-create-media.1.gz differ diff --git a/tools/man/immudex-crypt.1.gz b/tools/man/immudex-crypt.1.gz new file mode 100644 index 0000000..74e1112 Binary files /dev/null and b/tools/man/immudex-crypt.1.gz differ diff --git a/tools/man/immudex-hostname.1.gz b/tools/man/immudex-hostname.1.gz new file mode 100644 index 0000000..e723605 Binary files /dev/null and b/tools/man/immudex-hostname.1.gz differ diff --git a/tools/man/immudex-import-gpgkeys.1.gz b/tools/man/immudex-import-gpgkeys.1.gz new file mode 100644 index 0000000..b1178fa Binary files /dev/null and b/tools/man/immudex-import-gpgkeys.1.gz differ diff --git a/tools/man/immudex-import-sshkeys.1.gz b/tools/man/immudex-import-sshkeys.1.gz new file mode 100644 index 0000000..f0f4f58 Binary files /dev/null and b/tools/man/immudex-import-sshkeys.1.gz differ diff --git a/tools/man/immudex-install.1.gz b/tools/man/immudex-install.1.gz new file mode 100644 index 0000000..13ad22f Binary files /dev/null and b/tools/man/immudex-install.1.gz differ diff --git a/tools/man/immudex-meteo.1.gz b/tools/man/immudex-meteo.1.gz new file mode 100644 index 0000000..179dcbd Binary files /dev/null and b/tools/man/immudex-meteo.1.gz differ diff --git a/tools/man/immudex-motd.1.gz b/tools/man/immudex-motd.1.gz new file mode 100644 index 0000000..d10fa8b Binary files /dev/null and b/tools/man/immudex-motd.1.gz differ diff --git a/tools/man/immudex-padlock.1.gz b/tools/man/immudex-padlock.1.gz new file mode 100644 index 0000000..9b3fd03 Binary files /dev/null and b/tools/man/immudex-padlock.1.gz differ diff --git a/tools/man/immudex-pl.1.gz b/tools/man/immudex-pl.1.gz new file mode 100644 index 0000000..80506df Binary files /dev/null and b/tools/man/immudex-pl.1.gz differ diff --git a/tools/man/immudex-run.1.gz b/tools/man/immudex-run.1.gz new file mode 100644 index 0000000..3cab805 Binary files /dev/null and b/tools/man/immudex-run.1.gz differ diff --git a/tools/man/immudex-secured-firefox.1.gz b/tools/man/immudex-secured-firefox.1.gz new file mode 100644 index 0000000..b12f971 Binary files /dev/null and b/tools/man/immudex-secured-firefox.1.gz differ diff --git a/tools/man/immudex-secured-librewolf.1.gz b/tools/man/immudex-secured-librewolf.1.gz new file mode 100644 index 0000000..f910dba Binary files /dev/null and b/tools/man/immudex-secured-librewolf.1.gz differ diff --git a/tools/man/immudex-shoutcasts.1.gz b/tools/man/immudex-shoutcasts.1.gz new file mode 100644 index 0000000..4f790bb Binary files /dev/null and b/tools/man/immudex-shoutcasts.1.gz differ diff --git a/tools/man/immudex-upgrade.1.gz b/tools/man/immudex-upgrade.1.gz new file mode 100644 index 0000000..6412f4a Binary files /dev/null and b/tools/man/immudex-upgrade.1.gz differ diff --git a/tools/man/immudex-version.1.gz b/tools/man/immudex-version.1.gz new file mode 100644 index 0000000..f3e0039 Binary files /dev/null and b/tools/man/immudex-version.1.gz differ diff --git a/tools/man/immudex-ytplay.1.gz b/tools/man/immudex-ytplay.1.gz new file mode 100644 index 0000000..d4c93f1 Binary files /dev/null and b/tools/man/immudex-ytplay.1.gz differ diff --git a/tools/man/library.sh.1.gz b/tools/man/library.sh.1.gz new file mode 100644 index 0000000..ad0785f Binary files /dev/null and b/tools/man/library.sh.1.gz differ diff --git a/tools/misc/immudex-hostname.service b/tools/misc/immudex-hostname.service new file mode 100644 index 0000000..c65f2e3 --- /dev/null +++ b/tools/misc/immudex-hostname.service @@ -0,0 +1,9 @@ +[Unit] +Description=Set hostname based on Hardware model +Before=display-manager.service +[Service] +Type=OneShot +ExecStart=/usr/local/sbin/immudex-hostname +RemainAfterExit=yes +[Install] +WantedBy=multi-user.target diff --git a/tools/misc/motd.conf b/tools/misc/motd.conf new file mode 100644 index 0000000..1b62c4c --- /dev/null +++ b/tools/misc/motd.conf @@ -0,0 +1,18 @@ + +#MOUNT_POINTS - turning on file system space level monitoring. Mount points +#puted to variable must separated with space and $ on end up."; +MOUNT_POINTS="/$ /home$"; + +#OPTIONS - storage triggers for additional jobs, which script can do. At this +#moment we have: +#cryptparts - file system space level monitoring for LUKS parted disks, +#weather - put one line current weather status for declared location. It's +#requires LOCATION option configured. +OPTIONS="cryptparts weather"; + +#FOOTER - custom information printed before script end his execution. It could +#be anything. +FOOTER="morketsmerke.org @ 2026 https://github.com/xf0r3m/immudex" + +#LOCATION - not required option, it will be used to prints weather information +LOCATION="Warszawa"; diff --git a/tools/sbin/immudex-create-media b/tools/sbin/immudex-create-media new file mode 100755 index 0000000..1441f9d --- /dev/null +++ b/tools/sbin/immudex-create-media @@ -0,0 +1,137 @@ +#!/bin/bash + +GREEN="\e[32m"; +YELLOW="\e[33m"; +ENDCOLOR="\e[0m"; + +function help() { + echo "immudex-create-media it's script used for write iso image to usb drive."; + echo "Script writes .iso file to usb stick - make it then bootable. This" + echo "script prepare usb disks for 32-bit EFI systems." + echo "Superuser (root) privileges are required."; + echo; + echo "Usage: immudex-create-media [--help] [--version] [--i386-efi --disk=usb_disk --isofile=immudex.iso] [--nuke --disk=usb_disk] --disk=usb_disk --isofile=file.iso"; + echo; + echo "Options:"; + echo " --disk=/dev/sdX Indicates disk device."; + echo " --isofile=file.iso Indicates iso file."; + echo " --i386-efi --disk=/dev/sdX immudex.iso Creating 32-bit EFI bootable usb drive with iso image. (Compatibile with immudex images only.)"; + echo " --nuke --disk=/dev/sdX Write 0's to 1st megabyte of disk, wiping partition table."; + echo " --help Print this message."; + echo " --version Print information about version, author and copyrights."; + echo; + echo "Exmaples:"; + echo " immudex-create-media Print this message."; + echo " immudex-create-media --disk=/dev/sdX --isofile=file.iso Writes iso file to usb stick, made it bootable."; + echo " immudex-create-media --i386-efi --disk=/dev/sdX --isofile=immudex.iso Create 32-bit EFI bootable usb stick with immudex."; + echo " immudex-create-media --nuke --disk=/dev/sdX Writes first MB with 0's, deleting partition table"; + echo; + echo "Report bugs to "; +} + +function version() { + echo "immudex-create-media 1.0"; + echo; + echo "Copyright (C) 2026 morketsmerke.org"; + echo "This is free software; see the source for copying conditions. There is NO"; + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; + echo; + echo "Written by xf0r3m."; +} + +if [ $UID -ne 0 ]; then + echo "Permission denied!"; + help; + exit 1; +fi + +if [ "$1" ] && [ "$1" = "--help" ]; then help; exit 0; fi +if [ "$1" ] && [ "$1" = "--version" ]; then version; exit 0; fi + +if [ "$1" ] && [ "$1" = "--i386-efi" ]; then target="i386-efi"; shift; fi +if [ "$1" ] && [ "$1" = "--nuke" ]; then target="nuke"; shift; fi +if [ "$1" ] && [ "$(echo $1 | cut -d "=" -f 1)" = "--disk" ]; then + disk=$(echo $1 | cut -d "=" -f 2); shift; +else + help; + exit 1; +fi +if [ ! "$target" ] || [ "$target" != "nuke" ]; then + if [ "$1" ] && [ "$(echo $1 | cut -d "=" -f 1)" = "--isofile" ]; then + iso=$(echo $1 | cut -d "=" -f 2); + else + help; + exit 1; + fi +fi + +if [ "$target" = "i386-efi" ]; then + echo -n "Writing zeros to 1st megabyte on disk..."; + dd if=/dev/zero bs=1M of=$disk count=1 > /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi + + echo -n "Creating MS-DOS partitionig scheme on disk..."; + parted $disk mklabel msdos > /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi + + echo -n "Creating FAT-32 partition..."; + parted $disk mkpart primary fat32 1 100%Free > /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi + + echo -n "Creating VFAT filesystem on partition..."; + mkfs.vfat ${disk}1 > /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi + + echo -n "Creating /mnt/usb directory..."; + mkdir /mnt/usb > /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; + else echo -e "[${YELLOW}Directory exist!${ENDCOLOR}]"; fi + + echo -n "Mounting VFAT partition on /mnt/usb..."; + mount ${disk}1 /mnt/usb > /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi + + echo -n "Instalation GRUB on disk..."; + grub-install --target=i386-efi --efi-directory=/mnt/usb --boot-directory=/mnt/usb/boot --bootloader-id=boot --removable > /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi + + echo -n "Creating /mnt/iso directory..."; + mkdir /mnt/iso > /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; + else echo -e "[${YELLOW}Directory exist!${ENDCOLOR}]"; fi + + echo -n "Mounting iso file on /mnt/iso..."; + mount $iso /mnt/iso > /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi + + echo -n "Copying grub config files to the disk..."; + cp /mnt/iso/boot/grub/font.pf2 /mnt/usb/boot/grub > /dev/null 2>&1; + cp /mnt/iso/boot/grub/grub.cfg /mnt/usb/boot/grub > /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi + + echo -n "Copying immudex files to the disk..."; + cp -r /mnt/iso/live /mnt/usb > /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi + + echo -n "Creating empty DEBIAN file..."; + touch /mnt/usb/DEBIAN > /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi + + echo -n "Umounting all mounted filesystems..."; + umount /mnt/usb /mnt/iso > /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi + +elif [ "$target" = "nuke" ]; then + echo -n "Writing zeros to 1st megabyte on disk..."; + dd if=/dev/zero bs=1M of=$disk count=1 > /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi + +else + echo -n "Writing zeros to 1st megabyte on disk..."; + dd if=/dev/zero bs=1M of=$disk count=1 > /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi + + echo -n "Writing iso image to the disk..." + dd if=$iso bs=1M of=$disk > /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi +fi diff --git a/tools/sbin/immudex-crypt b/tools/sbin/immudex-crypt new file mode 100755 index 0000000..38fd47c --- /dev/null +++ b/tools/sbin/immudex-crypt @@ -0,0 +1,202 @@ +#!/bin/bash + +function help() { + + echo "immudex-crypt is script used for listing, open, close and create crypt_LUKS partitions."; + echo "Script creates 'immudex-crypt' mount points, every mount point end up with 'index'."; + echo "Index is order number of opening crypt_LUKS devices via 'immudex-crypt' The first"; + echo "opened device will have index equal 0, second = 1, and so on and on."; + echo "Superuser (root) privileges are required."; + echo; + echo "Usage: immudex-crypt [--list] [--create=/dev/partition] [--open=crypt_LUKS_device] [--close=index] [--help] [--version]"; + echo; + echo "Options:"; + echo " --list Prints list of opened and available crypt_LUKS devices."; + echo " --create=/dev/partition Preparing device for crypt_LUKS."; + echo " --open=/dev/crypt_LUKS_device Opening and mount crypt_LUKS device (create mount point, if not exist)."; + echo " --close=index Unmounting and close opened crypt_LUKS devices."; + echo " --help Prints this message."; + echo " --version Print information about version, author and copyrights."; + echo; + echo "Examples:"; + echo " immudex-crypt --list List available crypt_LUKS devices in the system."; + echo " immudex-crypt --create=/dev/sdX Create crypt_LUKS device from given partition."; + echo " immudex-crypt --open=/dev/sdX Open given crypt_LUKS device (with mounting file system, of course)."; + echo " immudex-crypt --close=0 Close first opened crypt_LUKS device in the system."; + echo; + echo "Report bugs to "; +} + +function version() { + echo "immudex-crypt 1.0"; + echo; + echo "Copyright (C) 2026 morketsmerke.org"; + echo "This is free software; see the source for copying conditions. There is NO"; + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; + echo; + echo "Written by xf0r3m."; +} + +function list() { + + mapperDeviceList=$(ls /dev/mapper | grep 'immudex-*' | awk '{printf $1" "}'); + + echo "=============================================================="; + echo -e "Opened devices:"; + echo "=============================================================="; + echo -e "Device:\t\tMapper name:\t\tMount point:"; + + if [ "$mapperDeviceList" ]; then + for dmDevice in $mapperDeviceList; do + if cryptsetup status /dev/mapper/${dmDevice} > /dev/null 2>&1; then + mountPoint=$(df --output=source,target /dev/mapper/${dmDevice} | tail -n 1 | awk '{printf $2}'); + device=$(cryptsetup status /dev/mapper/${dmDevice} | grep "device" | awk '{printf $2}'); + if [ "$mountPoint" ] && [ "$mountPoint" != "/dev" ]; then + echo -e "$device\t /dev/mapper/${dmDevice}\t$mountPoint"; + else + echo -e "$device\t /dev/mapper/${dmDevice}\tNot mounted"; + fi + fi + done + else + echo -e "No opened crypt devices was found"; + fi + echo "=============================================================="; + + luksDevicesList=$(blkid | grep 'LUKS' | cut -d ":" -f 1 | awk '{printf $1" "}'); + + echo "=============================================================="; + echo -e "crypt_LUKS devices:"; + echo "=============================================================="; + echo -e "Device:\t\t\tSize:"; + + if [ "$luksDevicesList" ]; then + for lDevice in $luksDevicesList; do + lDeviceSize=$(lsblk | grep "$(basename $lDevice)" | sed -n '1p' | awk '{printf $4}'); + echo -e "$lDevice\t\t$lDeviceSize"; + done + else + echo "No crypt device was found"; + fi + echo "=============================================================="; +} + +function open() { + + if [ $# -lt 1 ]; then help; exit 1; + else + index=$(ls --hide=control /dev/mapper | grep "immudex-crypt" | grep -o "[0-9]*$"| tail -1); + if [ "$index" ]; then + index=$((index + 1)); + else + index=0; + fi + cryptsetup open $1 immudex-crypt${index}; + mkdir -p /media/${USER}/immudex-crypt${index}; + lastField=$(ls -l /dev/mapper/immudex-crypt${index} | grep -o ' ' | wc -l); + dmDevice=$(ls -al /dev/mapper/immudex-crypt${index} | cut -d " " -f ${lastField}- | cut -d "/" -f2); + if ! $(file -s /dev/${dmDevice} | grep -q 'ext4'); then + echo "Could not determine filesystem of unlocked device."; + echo -n "Format this device to ext4? (y/n): " + read format; + if [ "$format" = "y" ]; then + mkfs.ext4 /dev/mapper/immudex-crypt${index}; + else + echo "Refuse to mount."; + cryptsetup close immudex-crypt${index}; + exit 1; + fi + fi + mount /dev/mapper/immudex-crypt${index} /media/${USER}/immudex-crypt${index}; + if [ ! -e /ic${index} ]; then + ln -s /media/${USER}/immudex-crypt${index} /ic${index}; + fi + fi + +} + +function close() { + + if [ $# -lt 1 ]; then help; exit 1; + else + if [ $1 -ge 0 ] 2> /dev/null; then + cryptfsName="immudex-crypt${1}"; + elif echo $1 | grep -q 'ic'; then + cryptfsName="immudex-crypt$(echo $1 | grep -o '[0-9]')"; + else + cryptfsName=$1; + fi + if cryptsetup status /dev/mapper/${cryptfsName} > /dev/null 2>&1; then + mountPoint=$(df --output=source,target /dev/mapper/${cryptfsName} | tail -1 | awk '{printf $2}'); + if [ "$mountPoint" ] && [ "$mountPoint" != "/dev" ]; then + umount -R $mountPoint; + cryptsetup close ${cryptfsName}; + else + cryptsetup close ${cryptfsName}; + fi + else + echo "Given devices isn't opened crypt device or it was closed before"; + fi + fi +} + +function create() { + if [ $# -lt 1 ]; then help; exit 1; + else + cryptsetup -y -v luksFormat $1; + fi +} + +function set_ownership(){ + if [ $# -lt 1 ]; then help; exit 1; + else + mountPoint=$(list | grep "$USER" | grep "$1" | awk '{printf $3}') + owner=$(stat -c %u $mountPoint); + if [ $owner -eq $RUID ]; then + if id $USER | grep -q $RUID; then + echo "User $USER is already owner of $mountPoint"; + fi + else + chown ${USER}:${USER} $mountPoint; + fi + fi +} + +if [ "$1" ]; then + + if [ $UID -ne 0 ]; then + echo "Permission denied!"; + help; + exit 1; + fi + + #immudex-crypt RUID is EUID of sudo, which spawning immudex-crypt + if $(pidof -sq sudo); then + export RUID=$(grep '^Uid:' /proc/$(pidof -s sudo)/status | awk '{printf $2}'); + export USER=$(grep "$RUID" /etc/passwd | cut -d ":" -f1); + fi + + option=$(echo $1 | cut -d '=' -f 1); + value=$(echo $1 | cut -d '=' -f 2-); + + case $option in + "--list") list;; + "--open") if [ "$value" ]; then open $value; + else help; exit 1; + fi;; + "--close") if [ "$value" ]; then close $value; + else help; exit 1; + fi;; + "--create") if [ "$value" ]; then + create $value; + open $value; + set_ownership $value; + else help; exit 1; + fi;; + "--help") help; exit 0;; + "--version") version; exit 0;; + *) help;; + esac +else + help; exit 1; +fi diff --git a/tools/sbin/immudex-hostname b/tools/sbin/immudex-hostname new file mode 100755 index 0000000..0788fc7 --- /dev/null +++ b/tools/sbin/immudex-hostname @@ -0,0 +1,58 @@ +#!/bin/bash + +function help() { + echo "immudex-hostname it's a main executional script for immudex-hostname"; + echo "service. The script job is to change set appropriate name for this"; + echo "host based on computer chassis and 7 last chars from boot ID." + echo; + echo "Usage: immudex-hostname [--help] [--version]"; + echo; + echo "Options:"; + echo " --help Print this message."; + echo " --version Print information about version, author and copyrights." + echo; + echo "Examples:"; + echo " immudex-hostname Set apropriate hostname, usually executed by systemd."; + echo " immudex-hostname --help Print this message."; + echo " immudex-hostname --version Print information about version, author and copyrights."; + echo; + echo "Files:"; + echo " /usr/lib/systemd/system/immudex-hostname.service Systemd unit file, to run immudex-hostname script as a service."; + echo; + echo "Report bugs to "; +} + +function version() { + echo "immudex-hostname 1.0"; + echo; + echo "Copyright (C) 2026 morketsmerke.org"; + echo "This is free software; see the source for copying conditions. There is NO"; + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; + echo; + echo "Written by xf0r3m."; + +} + +if [ "$1" ]; then + if [ "$1" = "--help" ]; then + help; + elif [ "$1" = "--version" ]; then + version; + fi +else + if [ $UID -ne 0 ]; then + echo "Permission denied!"; + exit 1; + fi + + bootID=$(sed 's/-//g' /proc/sys/kernel/random/boot_id | cut -c 26-33); + if hostnamectl > /dev/null 2>&1; then + hName="$(hostnamectl | grep 'Chassis' | cut -d ":" -f 2 | awk '{printf $1}')-${bootID}"; + else + hName="$(dmidecode -s chassis-type | head -1 | tr [A-Z] [a-z])-${bootID}"; + fi + + hostnamectl set-hostname $hName; + sed -i "s/immudex/${hName}/g" /etc/hosts; + echo $hName | sudo tee /etc/hostname > /dev/null; +fi diff --git a/tools/sbin/immudex-install b/tools/sbin/immudex-install new file mode 100755 index 0000000..fc07577 --- /dev/null +++ b/tools/sbin/immudex-install @@ -0,0 +1,196 @@ +#!/bin/bash + +RED="\e[31m"; +GREEN="\e[32m"; +ENDCOLOR="\e[0m"; + +function help() { + echo "it's a script for installation immudex LiveCD images on computer hard"; + echo "disk. This program runs interactivly and the one thing you need to do"; + echo "is choose a right disk for installation. That's all, but if you using"; + echo "custom images, you may need change partition size for immudex image." + echo "It's hard to imagine, how it's possible to create images bigger than 3"; + echo "GB. It would happens. More space in this partition is also needed for"; + echo "upgrades tasks. So if your image is bigger than 2 GiB, you need to "; + echo "change size of this partition before you start instalation."; + echo "Recomended size is 3 times the image size."; + echo "This script requires superuser (root) privileges."; + echo; + echo "Usage: immudex-install [--help] [--version]"; + echo; + echo "Options:"; + echo " --help Print this message."; + echo " --version Print information about version, author and copyrights."; + echo; + echo "Examples:"; + echo " immudex-install Standard execution, instalation immudex LiveCD on computer hard disk."; + echo " immudex-install --help Print this message."; + echo " immudex-install --version Print information about version, author and copyrights."; + echo; + echo "Report bugs to "; +} + +function version() { + echo "immudex-install 1.0"; + echo; + echo "Copyright (C) 2026 morketsmerke.org"; + echo "This is free software; see the source for copying conditions. There is NO"; + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; + echo; + echo "Written by xf0r3m."; + +} + +if [ "$1" ]; then + if [ "$1" = "--help" ]; then + help; + elif [ "$1" = "--version" ]; then + version; + fi +else +if [ $UID -ne 0 ]; then + echo "Permission denied!"; + exit 1; +fi + +while [ true ]; do + echo -e "${RED}This script will install immudex on first disk on your machine.${ENDCOLOR}"; + echo -e "${RED}It could be destructive for data placed on this disk${ENDCOLR}"; + echo -en "${RED}Are you sure that you want contiune? (y/n): ${ENDCOLOR}"; + read ans; + if [ "$ans" = "y" ]; then break; + elif [ "$ans" = "n" ]; then exit 1; + fi +done + +set -e + +function selectDisk() { + disks=$(lsblk | grep 'disk' | awk '{printf $1" "}'); + if [ $(echo $disks | wc -w) -gt 1 ]; then + select drive in $disks; do + echo $drive; + break; + done + else + echo $disks | awk '{printf $1}'; + fi +} + +if $(sudo efibootmgr > /dev/null 2>&1); then +#uefi installation + #partitioning + echo -n "Installation immudex in EFI mode ... "; + disk=$(selectDisk); + originDisk=$disk; + if [ ! "$disk" ]; then exit 1; fi + + dd if=/dev/zero bs=1M of=/dev/$disk count=1 2> /dev/null + + parted /dev/$disk mklabel msdos > /dev/null 2>&1; + parted /dev/$disk mkpart primary 1 101M > /dev/null 2>&1; + parted /dev/$disk set 1 boot on > /dev/null 2>&1; + parted /dev/$disk mkpart primary 101M 3G > /dev/null 2>&1; + + if $(echo $disk | egrep -qo "mmc|nvme"); then disk="${disk}p"; fi + + #formatting + mkfs.vfat -F32 /dev/${disk}1 > /dev/null 2>&1; + mkfs.ext4 /dev/${disk}2 > /dev/null 2>&1; + + #Setting label for partition + e2label /dev/${disk}2 "immudex" > /dev/null 2>&1; + + #mount root partition + mount /dev/${disk}2 /media > /dev/null 2>&1; + + #creating directories for efi partition + mkdir -p /media/boot/efi > /dev/null 2>&1; + + #mount efi partition + mount /dev/${disk}1 /media/boot/efi > /dev/null 2>&1; + + #mount iso image in /mnt directory + #sudo mount /dev/sr0 /mnt > /dev/null 2>&1; + + #copying whole iso image to the second partition + cp -rvv /run/live/medium/* /media > /dev/null 2>&1; + + sed -i '/set\ timeout=/ s/30/5/' /media/boot/grub/grub.cfg; + sed -i 's/bootfrom=removable //g' /media/boot/grub/grub.cfg; + + #removing unnecessary directories from second partition + rm -rf /media/isolinux > /dev/null 2>&1; + rm -rf /media/EFI > /dev/null 2>&1; + + #GRUB Installation + if [ -f /usr/lib/live/mount/medium/EFI/BOOT/BOOTIA32.EFI ]; then + target="i386-efi"; + else + target="x86_64-efi"; + fi + grub-install --target=${target} --root-directory=/media --boot-directory=/media/boot --efi-directory=/media/boot/efi --bootloader-id=debian --removable > /dev/null 2>&1; + + #Adding entry to EFI Firmware + efibootmgr -c -d /dev/${originDisk} -p 1 -L "Debian" -l '\EFI\BOOT\grubx64.efi' > /dev/null 2>&1; + + #Umount all mounted filesystems + umount -R /media > /dev/null 2>&1; + + if [ $? -eq 0 ]; then echo -e "[ ${GREEN}OK${ENDCOLOR} ]"; fi + +else +#mbr installation + echo -n "Installation immudex in BIOS mode ... "; + + #partitioning + disk=$(selectDisk); + if [ ! "$disk" ]; then exit 1; fi + + dd if=/dev/zero bs=1M of=/dev/$disk count=1 2> /dev/null + + parted /dev/$disk mklabel msdos > /dev/null 2>&1; + parted /dev/$disk mkpart primary 1 3G > /dev/null 2>&1; + parted /dev/$disk set 1 boot on > /dev/null 2>&1; + + if $(echo $disk | egrep -qo "mmc|nvme"); then disk="${disk}p"; fi + + #formatting + mkfs.ext4 /dev/${disk}1 > /dev/null 2>&1; + + #Setting label for partition is necessary for extlinux bootloader + e2label /dev/${disk}1 "immudex" > /dev/null 2>&1; + + #mount partition in /media directory + mount /dev/${disk}1 /media > /dev/null 2>&1; + + #Creating directory for extlinux + mkdir /media/extlinux > /dev/null 2>&1; + + #Instalation extlinux files in abovementioned directory + extlinux --install /media/extlinux > /dev/null 2>&1; + + #mount iso image in /mnt directory + #sudo mount /dev/sr0 /mnt > /dev/null 2>&1; + + #copying live directory from iso image to partition + cp -rvv /run/live/medium/live /media > /dev/null; 2>&1; + + #installation extlinux MBR on first sector of hard drive (whole device) + dd if=/usr/lib/EXTLINUX/mbr.bin of=/dev/${disk} > /dev/null 2>&1; + + #creating extlinux configuration file + cat > extlinux.conf < /dev/null 2>&1; + rm extlinux.conf; + + #Unmounting filesystems + umount /media > /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "[ ${GREEN}OK${ENDCOLOR} ]"; fi +fi +fi diff --git a/tools/sbin/immudex-upgrade b/tools/sbin/immudex-upgrade new file mode 100755 index 0000000..b9a849d --- /dev/null +++ b/tools/sbin/immudex-upgrade @@ -0,0 +1,146 @@ +#!/bin/bash + +set -e + +source library.sh + +RED="\e[31m"; +GREEN="\e[32m"; +YELLOW="\e[33m"; +ENDCOLOR="\e[0m"; +root="/run/live/medium"; + +function help() { + echo "Script for searching upgrades and upgrade immudex."; + echo "Superuser (root) privileges are required."; + echo; + echo "Usage: immudex-upgrade [--help] [--version] [--check] [--upgrade] [--myversion] [--compilation-date] [--packages-upgradable [--security]]"; + echo; + echo "Options:"; + echo " --check Check there are upgrades for immudex"; + echo " --upgrade Upgrade immudex from given source"; + echo " --myversion Prints image details"; + echo " --compilation-date Prints date of image creation"; + echo " --packages-upgradable [--security] Updates apt (packages) list and prints available to upgrade packages, with --security modificator prints only pacakages from security repository branch"; + echo " --help Prints this message."; + echo " --version Prints information about version, author and copyrights."; + echo; + echo "Report bugs to "; +} + +function version(){ + echo "immudex-upgrade 1.0"; + echo; + echo "Copyright (C) 2026 morketsmerke.org"; + echo "This is free software; see the source for copying conditions. There is NO"; + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; + echo; + echo "Written by xf0r3m."; +} + +if [ $UID -ne 0 ]; then + echo "Permission denied!"; + help; + exit 1; +fi + +if [ "$1" ]; then + if [ "$1" = "--help" ]; then + help; + exit 0; + elif [ "$1" = "--version" ]; then + version; + exit 0; + fi + if [ "$1" ] && [ "$1" = "--check" ]; then + if check_distro_commit; then + echo -e "${GREEN}This${ENDCOLOR} is the latest version of immudex"; + else + echo -e "There is a ${RED}new${ENDCOLOR} version of immudex:"; + echo "==================================================="; + check_distro_commit --print; + fi + elif [ "$1" ] && [ "$1" = "--upgrade" ]; then + part=$(blkid | grep 'LABEL="immudex"' | awk '{printf $1}' | cut -d ":" -f 1); + if mount | grep -q "$part"; then + echo -n "Mounting iso image..."; + mount $2 /mnt > /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "[ ${GREEN}OK${ENDCOLOR} ]"; fi + mountPointList=$(mount | grep "$part" | awk '{printf $3" "}'); + for mountPoint in $mountPointList; do + echo -n "Unlocking $mountPoint ..."; + mount $part $mountPoint -o remount,rw > /dev/null 2>&1; + if [ $? -eq 0 ]; then + echo -e "[ ${GREEN}OK${ENDCOLOR} ]"; + else + echo -e "[ ${RED}FAIL${ENDCOLOR} ]"; + fi + done + echo "Copying immudex files to the disk..."; + cp -vv /mnt/live/* ${mountPoint}/live; + if [ $? -eq 0 ]; then + echo -e "Copying immudex files to the disk...[ ${GREEN}OK${ENDCOLOR} ]"; + else + echo -e "Copying immudex files to the disk...[ ${RED}FAIL${ENDCOLOR} ]"; + fi + else + echo -n "Mounting immudex partition..."; + mount $part /mnt >> /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "[ ${GREEN}OK${ENDCOLOR} ]"; fi + echo "Copying immudex files to the disk..."; + cp -vv /run/live/medium/live/* /mnt/live; + if [ $? -eq 0 ]; then + echo -e "Copying immudex files to the disk...[ ${GREEN}OK${ENDCOLOR} ]"; + else + echo -e "Copying immudex files to the disk...[ ${RED}FAIL${ENDCOLOR} ]"; + fi + fi + if $(sudo efibootmgr > /dev/null 2>&1); then + echo "Copying grub config to the disk..."; + if [ "$mountPoint" ]; then + cp -vv /mnt/boot/grub/grub.cfg ${mountPoint}/boot/grub/grub.cfg; + if [ $? -eq 0 ]; then + echo -e "Copying grub config to the disk...[ ${GREEN}OK${ENDCOLOR} ]"; + sed -i '/set\ timeout=/ s/30/5/' ${mountPoint}/boot/grub/grub.cfg; + sed -i 's/bootfrom=removable //g' ${mountPoint}/boot/grub/grub.cfg; + else + echo -e "Copying grub config to the disk...[ ${RED}FAIL${ENDCOLOR} ]"; + fi + else + cp -vv /run/live/medium/boot/grub/grub.cfg /mnt/boot/grub/grub.cfg; + if [ $? -eq 0 ]; then + echo -e "Copying grub config to the disk...[ ${GREEN}OK${ENDCOLOR} ]"; + sed -i '/set\ timeout=/ s/30/5/' /mnt/boot/grub/grub.cfg; + sed -i 's/bootfrom=removable //g' /mnt/boot/grub/grub.cfg; + else + echo -e "Copying grub config to the disk...[ ${RED}FAIL${ENDCOLOR} ]"; + fi + fi + fi + elif [ "$1" ] && [ "$1" = "--myversion" ]; then + #if [ -d /tmp/immudex ]; then + # (cd /tmp/immudex && git pull > /dev/null 2>&1) + #else + # git clone https://github.com/xf0r3m/immudex /tmp/immudex; + #fi + #(cd /tmp/immudex && git show $(cat /run/live/medium/live/version)) + cat /run/live/medium/live/changelog; + elif [ "$1" ] && [ "$1" = "--packages-upgradable" ]; then + apt update; + if [ "$2" ] && [ "$2" = "--security" ]; then + apt list --upgradable | grep 'security'; + else + apt list --upgradable; + fi + elif [ "$1" ] && [ "$1" = "--compilation-date" ]; then + eval $(grep '^COMPILATION_DATE' /run/live/medium/live/changelog); + echo "Image was created: $COMPILATION_DATE"; + else + help; + exit 1; + fi +else + help; + exit 1; +fi + diff --git a/versions/base.sh b/versions/base.sh index 5e39cbf..cbb4079 100644 --- a/versions/base.sh +++ b/versions/base.sh @@ -12,8 +12,8 @@ else fi cd; -if [ -x /usr/bin/git ]; then git clone https://git.morketsmerke.org/git/immudex; -else apt install git -y && git clone https://git.morketsmerke.org/git/immudex; +if [ -x /usr/bin/git ]; then git clone https://github.com/xf0r3m/immudex; +else apt install git -y && git clone https://github.com/xf0r3m/immudex; fi source ~/immudex/versions/template.sh; @@ -38,8 +38,7 @@ dpkg-reconfigure console-setup; install_packages task-desktop task-xfce-desktop; -#Usunięcie pakietów make oraz gimp - 22.11.2025; -install_packages firejail ufw cryptsetup lsof extlinux grub-efi-amd64 efibootmgr bash-completion etherwake wakeonlan cifs-utils wget figlet vim-gtk3 redshift irssi nmap nfs-common remmina python3-pip ffmpeg debootstrap squashfs-tools xorriso syslinux-efi grub-pc-bin grub-efi-amd64-bin mtools dosfstools chrony python3-venv isolinux rsync mutt openvpn netselect-apt gvfs-backends dnsutils lolcat cdparanoia icedax mc minicom; +install_packages firejail ufw cryptsetup lsof extlinux grub-efi-amd64 efibootmgr bash-completion etherwake wakeonlan cifs-utils wget figlet redshift irssi nmap nfs-common remmina python3-pip ffmpeg debootstrap squashfs-tools xorriso syslinux-efi grub-pc-bin grub-efi-amd64-bin mtools dosfstools chrony python3-venv isolinux rsync mutt gimp openvpn netselect-apt gvfs-backends dnsutils lolcat cdparanoia icedax mc minicom; cd; @@ -52,29 +51,32 @@ if [ -f /usr/bin/youtube-dl ]; then rm /usr/bin/youtube-dl; fi ytdlpVer=$(curl https://github.com/yt-dlp/yt-dlp/releases.atom 2>/dev/null | grep '.*$' | sed -n '2p' | sed 's/\ /\n/g' | tail -1 | sed 's,,,'); wget https://github.com/yt-dlp/yt-dlp/releases/download/${ytdlpVer}/yt-dlp -O /usr/bin/yt-dlp -#Polityka antyfrankensteinowa - 13.05.2024 +#Zapewnienie kompatybilnosci wstecznej dla programów korzystających youtube-dl; ln -s /usr/bin/yt-dlp /usr/bin/youtube-dl; cd; -wget https://ftp.morketsmerke.org/youtube-search/python3-youtube-search_2.2.0.deb -apt install ./python3-youtube-search_2.2.0.deb -y -git clone https://git.morketsmerke.org/git/immudex-tools; -cp -vv ~/immudex-tools/bin/* /usr/local/bin; +wget https://ftp.morketsmerke.org/youtube-search/python3-youtube-search_2.2.0.deb; +apt install ./python3-youtube-search_2.2.0.deb -y -git clone https://git.morketsmerke.org/git/immudex-only-tools; -cp -vv ~/immudex-only-tools/bin/* /usr/local/bin; +cp -vv ~/immudex/tools/bin/* /usr/local/bin; chmod +x /usr/local/bin/*; -cp -vv ~/immudex-tools/sbin/* /usr/local/sbin; -cp -vv ~/immudex-only-tools/sbin/* /usr/local/sbin; +cp -vv ~/immudex/tools/sbin/* /usr/local/sbin; chown root:root /usr/local/sbin/*; chmod 544 /usr/local/sbin/*; -cp -vv ~/immudex-tools/misc/motd.conf /etc/motd.conf; -cp -vv ~/immudex-only-tools/misc/immudex-hostname.service /etc/systemd/system; +cp -vv ~/immudex/tools/misc/motd.conf /etc/motd.conf; +cp -vv ~/immudex/tools/misc/immudex-hostname.service /etc/systemd/system; systemctl enable immudex-hostname.service; +if [ ! -d /usr/share/man/man1 ]; then mkdir /usr/share/man/man1; fi +cp -vv ~/immudex/tools/man/* /usr/share/man/man1; + +mkdir /etc/skel/.irssi + +cp -vv ~/immudex/files/config /etc/skel/.irssi; +cp -vv ~/immudex/files/default.theme /etc/skel/.irssi; cp -rvv ~/immudex/files/libreoffice /etc/skel/.config; cp -vv ~/immudex/files/firejail.config /etc/firejail; cp -vv ~/immudex/files/redshift.conf /etc/skel/.config; @@ -84,17 +86,13 @@ if [ -h /usr/share/applications/qmmp-1.desktop ]; then rm /usr/share/applications/qmmp-1.desktop; fi -cp -vv ~/immudex/launchers/*.desktop /usr/share/applications; -cp -vv ~/immudex/files/whiskermenu-1.rc /etc/skel/.config/xfce4/panel/whiskermenu-1.rc; +tar -xf ~/immudex/files/mozilla.tgz -C /etc/skel; cp -vv ~/immudex/launchers/16844254192.desktop /etc/skel/.config/xfce4/panel/launcher-5; -tar -xzvf ~/immudex/files/mozilla.tgz -C /etc/skel; - - cat >> /etc/bash.bashrc << EOL if [ ! -f /tmp/.motd ]; then -/usr/local/bin/immudex-motd +/usr/local/bin/immudex-motd2 touch /tmp/.motd; fi EOL diff --git a/versions/template.sh b/versions/template.sh index be87380..51d3083 100644 --- a/versions/template.sh +++ b/versions/template.sh @@ -39,10 +39,8 @@ function tidy() { apt-get autoremove -y; apt-get autoclean; rm -rf ~/immudex; - rm -rf ~/immudex-tools; - rm -rf ~/immudex-only-tools; - rm ~/python3-youtube-search*.deb; if [ -d ~/xfcedebian ]; then rm -rf ~/xfcedebian; fi + rm ~/python3-youtube-search*.deb; rm /var/cache/apt/*.bin; echo > ~/.bash_history; history -c