Compare commits
2 Commits
afef2e3591
...
16fbf5dc41
Author | SHA1 | Date | |
---|---|---|---|
16fbf5dc41 | |||
b3dbe43239 |
38
change-username.sh
Executable file
38
change-username.sh
Executable file
|
@ -0,0 +1,38 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# A script to change the current username
|
||||||
|
|
||||||
|
# Get current username
|
||||||
|
printf "\nType the current username:\n"
|
||||||
|
read old
|
||||||
|
|
||||||
|
# Set desired username
|
||||||
|
printf "\nType the desired username:\n"
|
||||||
|
read new
|
||||||
|
|
||||||
|
# Home paths
|
||||||
|
ohp="home/$old"
|
||||||
|
nhp="home/$new"
|
||||||
|
|
||||||
|
# Change username
|
||||||
|
printf "\nChanging username\n"
|
||||||
|
|
||||||
|
for file in group gshadow passwd shadow subgid subuid
|
||||||
|
do
|
||||||
|
sed -i "s/$old/$new/g" /etc/$file*
|
||||||
|
done
|
||||||
|
|
||||||
|
# Rename home folder
|
||||||
|
mv /$ohp /$nhp
|
||||||
|
|
||||||
|
# Fix path references in /home for new user
|
||||||
|
printf "\nAdjusting paths in home directory\n"
|
||||||
|
|
||||||
|
grep -rl "$ohp" /$nhp | xargs sed -i "s+$ohp+$nhp+g"
|
||||||
|
|
||||||
|
# Set user info
|
||||||
|
echo
|
||||||
|
chfn $new
|
||||||
|
sync
|
||||||
|
|
||||||
|
reboot
|
30
mms-check
Executable file
30
mms-check
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
#!/usr/bin/perl
|
||||||
|
|
||||||
|
# Check ModemManager for pending SMS/MMS messages clogging its queue.
|
||||||
|
# Until mobile Linux natively supports MMS messages, ModemManager is
|
||||||
|
# needed along with Janky MMS (https://git.sr.ht/~amindfv/jmms) to get
|
||||||
|
# your messages and flush the queue; if the queue gets clogged you don't
|
||||||
|
# get incoming messages anymore.
|
||||||
|
|
||||||
|
# Usage: run this in your .bashrc so it'll print in your new terminal
|
||||||
|
# session to remind you that messages are pending.
|
||||||
|
|
||||||
|
use 5.12.0;
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
# Find modem ID
|
||||||
|
my $modem;
|
||||||
|
my $list = `mmcli -L`;
|
||||||
|
if ($list =~ m{/Modem/(\d+)}i) {
|
||||||
|
$modem = $1;
|
||||||
|
} else {
|
||||||
|
die "didn't find modem id";
|
||||||
|
}
|
||||||
|
|
||||||
|
my $chk = `mmcli -m $modem --messaging-list-sms`;
|
||||||
|
my @lines = split(/\n/, $chk);
|
||||||
|
if ($chk !~ /no sms messages were found/i) {
|
||||||
|
say "Notice: mmcli shows there are pending SMS messages:";
|
||||||
|
say $chk;
|
||||||
|
}
|
11
mms-read
Executable file
11
mms-read
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Wrapper for Jenky MMS (https://git.sr.ht/~amindfv/jmms)
|
||||||
|
# Until MMS is natively supported in mobile Linux, this command
|
||||||
|
# will use jmms to read your pending MMS messages. For this to
|
||||||
|
# work the WiFi needs switched off as only the 4G LTE connection
|
||||||
|
# has authentication to read from (T-Mobile's) servers.
|
||||||
|
|
||||||
|
sudo nmcli radio wifi off
|
||||||
|
jmms --get
|
||||||
|
sudo nmcli radio wifi on
|
Loading…
Reference in New Issue
Block a user