Search found 435 matches
- Tue Feb 23, 2021 2:37 pm
- Forum: Scripts & Bash
- Topic: Possible Exploit with Copy/Paste to Terminal?
- Replies: 17
- Views: 798
Re: Possible Exploit with Copy/Paste to Terminal?
if this was an exploit and it the command had sudo, you would still have to enter your password Yes. I realize I'm posting a month late to the discussion, but this may still be helpful to point out. One thing about "sudo" use is that once you successfully use sudo in a terminal, you do no...
- Fri Dec 04, 2020 11:43 pm
- Forum: Scripts & Bash
- Topic: [SOLVED] Bash script to advise when Internet restored
- Replies: 9
- Views: 703
Re: Bash script to advise when Internet restored
If you suspect line-ending problems, check your file size. I copied your code at the end and have a 1023-byte file, which does execute correctly (other than paplay which I do not have).Busker wrote: ↑Fri Dec 04, 2020 7:33 pmCode: Select all
-rwxrwxr-x 1 tux tux 1033 Nov 12 14:03 tint.sh
- Fri May 08, 2020 1:23 am
- Forum: Scripts & Bash
- Topic: Need help to create login script to modify /etc/hosts
- Replies: 12
- Views: 1001
Re: Need help to create login script to modify /etc/hosts
I know I'm a little late to reply. If you've not already found a solution, here's another suggestion which may or may not help your particular case. You could put a few entries in /etc/crontab to run, say, (a) M-F at 8am (or whenever) to copy your restricted hosts file, then (b) at 4pm to copy your ...
- Fri Jan 24, 2020 11:59 pm
- Forum: Scripts & Bash
- Topic: cannot cp file to directory with spaces in name
- Replies: 8
- Views: 1774
Re: cannot cp file to directory with spaces in name
I know it's already been asked and answered. The two problems were: 1) You were escaping the quotation marks. "/home/bobi/tmp/\"dir with spaces\"" is not the same as /home/bobi/tmp/"dir with spaces" The first has the quotation marks in the directory name, which is not w...
- Sat Mar 02, 2019 1:06 pm
- Forum: Scripts & Bash
- Topic: Script users
- Replies: 13
- Views: 1322
Re: Script users
The purpose of the script is to request a username, if it does not exist, and then create it. But if it already exists ask for another name. #! / bin / bash echo -n "Do you want to enter a user? (s / N):"; read answer yes [$ answer = 's']; so echo "Enter the user:" read USER if ...
- Sat Mar 02, 2019 12:25 pm
- Forum: Newbie Questions
- Topic: How to force an application to start on secondary display
- Replies: 3
- Views: 643
Re: How to force an application to start on secondary display
NOTE I'm not running Mint 19.1 Cinnamon. I do use a dual-monitor setup. My desktop is XFCE. I have noticed that the behavior seems largely program-dependent. In general, most programs seem to open their window on whatever monitor the mouse is currently positioned. So I usually position the mouse to ...
- Fri Feb 22, 2019 10:48 pm
- Forum: Scripts & Bash
- Topic: shutdown via cron? [solved]
- Replies: 9
- Views: 1222
- Tue Feb 12, 2019 10:32 am
- Forum: Other topics
- Topic: Do I really need to encrypt home if I have full disk encryption?
- Replies: 19
- Views: 2089
Re: Do I really need to encrypt home if I have full disk encryption?
2) Are there any benefits to having the `home` encrypted with encfs if full-disk LUKS encryption is also enabled? Not in a single user scenario. In a multi-user scenario it gives protection from other users (including administrators) accessing your files. Ideally, yes. However in testing (on LM18) ...
- Tue Jan 29, 2019 11:24 pm
- Forum: Newbie Questions
- Topic: New Linux user from windows 10
- Replies: 21
- Views: 1970
Re: New Linux user from windows 10
So as a new user who isn’t very technical, what would you recommend. For a new user, I recommend mint, mainly because of the forums :-) You can almost always find some kind of help/support, answers to questions... Biased? Maybe. But I don't use mint as my main o/s anymore (I do still run it in a vm...
- Sun Jan 27, 2019 2:32 pm
- Forum: Scripts & Bash
- Topic: New to automation/scripting, Switch to python?
- Replies: 2
- Views: 673
Re: New to automation/scripting, Switch to python?
Just a suggestion to make it a little more readable, I prefer using echo -e "blahblah\n\n" -- the \n will insert a newline for you. In fact you could even combine the command you're running along with the echo command. Such as: echo -e "Sockets:\n\n\n$(sudo systemctl -l|grep .socket)\...
- Sat Jan 26, 2019 10:34 am
- Forum: Newbie Questions
- Topic: Unexpected behaviour of Rsync
- Replies: 45
- Views: 1726
Re: Unexpected behaviour of Rsync
Both DIR and LS commands report the file as being without the trailing period. tony@tony-Latitude-E6430 /media/tony/DropBox_A/Dropbox/New_Pics_vids/catalogueds/2012-06-03 $ ls 143*.*|hexdump -C 00000000 31 34 33 2e 4a 50 47 0a |143.JPG.| 00000008 tony@tony-Latitude-E6430 /media/tony/DropBox_A/Dropb...
- Fri Jan 25, 2019 10:01 am
- Forum: Newbie Questions
- Topic: Motherboard code 90 error after adding second drive
- Replies: 4
- Views: 163
Re: Motherboard code 90 error after adding second drive
By comment out I assume you mean remove/delete the swap entry line from the text? To "comment out" means to change the line into a comment. In this case, put a # symbol at the beginning of the line: # /swapfile none swap sw 0 0 This will disable the line from being run, and still leave it...
- Fri Jan 25, 2019 9:53 am
- Forum: Scripts & Bash
- Topic: Create ZIP File for Each Folder Bash Command
- Replies: 1
- Views: 572
Re: Create ZIP File for Each Folder Bash Command
I think you're forgetting to tell 7z *what* to compress, it's doing the current working directory each time (?). Using your first example, try:
Code: Select all
#!/bin/bash
for Folder in /Data/*
do
if [ -d "$Folder" ]
then
7z a -tzip -mx1 "${Folder%}.bak" "$Folder/"
fi
done
- Sat Jan 19, 2019 1:59 pm
- Forum: Newbie Questions
- Topic: Self-destructing clipboard
- Replies: 18
- Views: 2799
Re: Self-destructing clipboard
For manual clearing, run xsel -cb; xsel -cp; xsel -cs maybe set it up on a hotkey to run as needed. (requires xsel, not sure if that's installed by default but probably not). The three commands will clear the clipboard, primary selection, and secondary selection. If you usually use the keyboard shor...
- Sat Jan 05, 2019 11:17 am
- Forum: Software & Applications
- Topic: I tried to compile source install but it failed. help.
- Replies: 37
- Views: 3494
Re: I tried to compile source install but it failed. help.
A quick related question for you fellow handbrakers... I use another debian derivative, I download the source bz2 and compile... no major problems for me so far (occasionally need to install/update a dependency). However it seems like my "Automatically check for updates" option does nothin...
- Sun Dec 23, 2018 10:21 pm
- Forum: Other networking topics
- Topic: Configure a virtual network device so 1 computer has 2 IP's [solved]
- Replies: 8
- Views: 505
Re: Configure a virtual network device so 1 computer has 2 IP's [solved]
NOT an answer to your question specifically, but a somewhat related matter: You can have multiple IP addresses assigned to a physical device, i.e. ifconfig eth0 192.168.1.2 ifconfig eth0:1 192.168.2.2 ifconfig eth0:2 192.168.3.1 This can be useful for specific software (postfix and apache, for insta...
- Sat Dec 22, 2018 1:22 am
- Forum: Newbie Questions
- Topic: [solved] Need help with bash script...
- Replies: 15
- Views: 452
Re: [solved] Need help with bash script...
If you're more comfortable with C, there is a C-shell ( apt install csh ). I haven't used it in ages... Your initial script would look something like this (not tested) :) #!/bin/csh # get the current slideshow folder set DESK_BACKGROUND = `gsettings get org.cinnamon.desktop.background.slideshow imag...
- Sat Dec 08, 2018 2:03 pm
- Forum: Hardware Support
- Topic: Don't buy Asrock
- Replies: 25
- Views: 12552
Re: Don't buy Asrock
My ASRock Z77 Extreme6 from 2012 runs linux just fine. Even hibernate and suspend work! I've not had to deal with their customer service. I've run a variety of kernels on this over the years -- a couple kernel updates have given problems that were later fixed.
- Thu Aug 30, 2018 10:18 pm
- Forum: Software & Applications
- Topic: trying to mount samsung galaxy tab a
- Replies: 6
- Views: 1184
Re: trying to mount samsung galaxy tab a
You could try gmtp.
apt install gmtp
to install; then gmtp
(or navigate the menu) to run it.- Wed Aug 29, 2018 4:15 pm
- Forum: Scripts & Bash
- Topic: [SOLVED] bash changes { to %7B and } to %7D
- Replies: 6
- Views: 880
Re: bash changes { to %7B and } to %7D
Hmm.. how are you calling the script?
Other than that, I'm also confused why it would behave differently.
./script.sh
is not the same as sh ./script.sh
Other than that, I'm also confused why it would behave differently.
Code: Select all
$ cat test.sh
#!/bin/bash
echo {01..10}
$ ./test.sh
01 02 03 04 05 06 07 08 09 10
$ dash ./test.sh
{01..10}
$