Tag Info

New answers tagged

0

Manage to fix both problems. For the clipboard problem, I installed the ClipIt sudo apt-get install clipip and in the preferences I checked Use ctrl+c and unchecked Use Primary (Selection) The problem with the shell command not getting the sub-string properly I used sed instead: artist=$(banshee --query-artist);title=$(banshee --query-title);echo $artist ...


0

First, unmount the USB device and then use lsblk to verify the device. Sometimes (usually older iso files) dd is not sufficient and the pendrive will not boot. In this case, you may need to install syslinux: sudo apt-get install syslinux and then run the following commands: sudo mkfs -t vfat -I /dev/sdX You want to run that last command to /dev/sdX ...


0

I can answer only part of the question. Even for me it gives the same output on trusty. But when I go to a tty, then I get the tty login too. So that part is working. I think what has changed is the tty that is used to log into unity.


1

.srt files are .txt files with an .srt extension, so you can open an .srt file in Gedit Text Editor and and easily delete a text string like <i> or </i> using Search -> Replace (which opens a new Replace window) -> Replace All. You can also replace text strings in the Gnome Subtitiles application, however Search -> Replace in Gnome Subtitles ...


1

Via sed but that is only good enough for simplistic HTML.. For a better solution via perl or html2text, see below. sed -i".$(date +'%s').bak" 's/<[^>]*>//g' your_input_file Explanation -i".$(date +'%s').bak" edit files in place (makes backup if SUFFIX supplied) 's/<[^>]*>//g' < matches the characters < literally [^>]* ...


1

rename doesn't work that way; you need to specify a PCRE (Perl Compatible Regular Expression) pattern and replacement to work with it. For this purpose, mv is enough; a fast way to rename all the .htaccess files in /var/www would be to use find itself: find /var/www -type f -name '.htaccess' -execdir mv {} old.htaccess \; Sample output on a test ...


0

a simple one-liner that tests how long it takes to download 100MB (works on /bin/sh also): t=$(date +"%s"); wget http://speedtest.netcologne.de/test_100mb.bin -O ->/dev/null ; echo -n "mBit/s:"; expr 8 \* 100 / $(($(date +"%s")-$t)) explanation: store the timestamp in $t download 100mb but don't store anything calculate 8 * 100mb / $t Note: ...


0

rsync -aAXhv /home/levan/kdenlive/untitelds.mpg /media/sda3/SkyDrive/ This will copy the "untitelds.mpg" file in the SkyDrive directory without deleting anything


0

"Writable by non-owner" means that the current permissions of /var/lib/sudo allow either the file's group group or the file's other group to write into the directory, whilst only the owner (root) should be able to do so. Removing the write permission for the group group and for the other group (chmod go-w /var/lib/sudo) should suffice, however since the ...


0

Not a direct answer to the question (chaos and steeldriver have already provided what I think would be the best literal solutions), but if you only need to ssh to the one user at the one address in the majority of cases, then looking at editing the .bash_aliases file in your home directory should be useful, as you can create an alias for the entire terminal ...


2

Of course for your particular issue you want to follow @chaos and @steeldriver advices, but in the general case, in order to "permanently store values in the terminal", you are looking to shell variables. How to set them will depend on your shell (I guess echo $SHELL will provide the relevant information). If by "permanently" you mean "as long as I don't ...


0

I would go for p7zip-full and p7zip-rar packages. From the package description: Unpacking only: APM, ARJ, CAB, CHM, CPIO, CramFS, DEB, DMG, FAT, HFS, ISO, LZH, LZMA, LZMA2, MBR, MSI, MSLZ, NSIS, NTFS, RAR (only if non-free p7zip-rar package is installed), RPM, SquashFS, UDF, VHD, WIM, XAR and Z. 7z is the executable. Another useful ...


1

Run echo -e "lms\nlocalhost" >> test.txt \n is for a new line. >> redirects output to a file and appends it to the end of the file. -e is to parse control characters like \n.


14

For SSH connections, you can create a user configuration file ~/.ssh/config and place the mappings there e.g. Host server1 Hostname 111.222.111.222 You can easily add other fields such as Port (for non-standard ports) and User (useful if your username on the remote system differs from that on the local system). See man ssh_config for full details.


8

Yes, just write them down in the file /etc/hosts. It has the following syntax: 1.2.3.4 servername additional_servername Where: 1.2.3.4 is the IP address servername is the name additional_servername is an optional name After saving, you can reach the server by its name.


0

timestamp=$(date -d "18:30 yesterday" +%s) stat -c "%Y %n" * | while IFS= read -r mtime filename; do if (( mtime < timestamp )); then mv "$filename" /some/folder fi done


0

try which nodemon to find out if that command is already there. It should run by using nodemon server.js Also make sure you run command in global mode npm install nodemon -g


1

you can use find. In your case you can run find -maxdepth 1 -iname 'jre*' Explanation: find searches for files/directories with the given parameters: -maxdepth 1 restricts the search to the current directory. Otherwise, it would search in all subdirectories too. -iname takes the pattern and searches case insensitive. The pattern itself 'jre*' means the ...


0

Find should do the trick: find . -iname 'jre*'


-1

Here is how I handled it, after reading this thread; I tried first to check the file permissions, through the graphical interface, by opening 'home', 'download', i.e. the location where I put netbeans-8.0.2-linux.sh; seeing the button for changing the file to executable was unchecked, I checked it; I opened a terminal, changed to the directory where ...


3

Scripts execute commands in sequence, and wait until each command finishes. However, there is a way to allow the script to continue executing past a specific command - add & on the end of the script. For instance: !#/bin/bash firefox echo "Next line" Will wait till firefox is closed. !#/bin/bash firefox & echo "Next line" Will execute echo ...


0

Try using [0-9] that covers all number then filter the range to limit to numbers below 255


3

You misunderstand regular expressions: [0-255] does not mean "a decimal number between 0 and 255", but means "one of 0, 1, 2 or 5". This is the correct regular expression: \b(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\b If you try, you should get the following output: $ grep -E '\b(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\b' asd.txt 1335.0.1.234 241.92.88.103 ...


1

Regarding your first question - this is normal UNIX behavior. It will not display anything while you type a password. It is "concealed". Trust that it is indeed there, and press Enter when you're finished typing. Since concealing like this is possible by using a simple ANSI escape code (the same method by which we color and bold text in the terminal), it is ...


2

Well... This is bigger than I originally thought. Firstly we need a few things. sudo apt-get install fontforge python-scour woff-tools build-essential git clone http://github.com/behdad/fonttools ~/src/fonttools ln -s ~/src/fonttools/Tools/pyftsubset ~/bin/subset # vanity symlink git clone https://github.com/metaflop/ttf2eot.git ~/src/ttf2eot cd ...


0

You can add interesting ASCII arts on your terminal without leaving your terminal. cowsay has some of the coolest ASCII arts and piping fortune outputs into cowsay can take this to another level. Lets see how this is done, open your terminal and type: sudo apt-get install cowsay Now cowsay is installed lets have some fun, add following command cowsay I ...


2

You may use sed inside the two command substitutions to process the original files prior their listing within the arguments of the program (thanks to steeldriver for the simplified pattern): program -input "$(sed "s@^\|,@&$source1@g" file1.txt)" -input2 "$(sed "s@^\|,@&$source2@g" file2.txt)" I changed the sed commands' default delimiter (/) to @ ...


3

you can redirect STDOUT to /dev/null this will prevent printing output and only prints STDERR to your terminal. You can use it like yourfavouriteprogram > /dev/null And yes, it is faster: time head -100000 large_file.txt real 0m16.570s user 0m0.009s sys 0m0.189s time head -100000 large_file.txt > /dev/null real 0m0.018s user ...


0

I had this problem too. I needed to (in bash) export VIMRUNTIME=/usr/share/vim/vim73 then run (in vim) :syntax on (In my case vim was looking in /usr/share/vim/vim74, and there is no /usr/local/share/.... I was on an AWS EC2 Ubuntu.) Also it needed to be VIMRUNTIME, not VIMRUNTIMEDIR.


1

First an explanation, thank you @kos By using an Exec= line such as Exec=/usr/local/netbeans-8.0/bin/netbeans netbeans is executed in sh already, because the Exec= lines in desktop files are executed as commands in sh, not in bash or else. So Exec=/bin/sh -c "/usr/local/netbeans-8.0/bin/netbeans" spawns an excessive sh instance. Just ...


1

I figured out the issue by looking through syslog. I probably should have done that to begin with, but I'm still a Linux noob. Sorry if I wasted anyone's time! Apparently, Netbeans was failing to pick up a tool agent. Specifically, the instrumentation tool Jayatanaag.jar. For some reason, this didn't cause a fail state when starting directly from a ...


1

try without /bin/sh Exec=/usr/local/netbeans-8.0/bin/netbeans


1

I'm the maintainer of subliminal. Latest version of subliminal (1.0.1 as I'm writing this) brings a lot of fixes and a brand new command line interface that is much easier to work with and nicer to look. There is a soon-to-be-released example that integrates subliminal with the Nautilus file manager to add a right click context menu. Screenshot and install ...


3

Use zsh's trap builtin (the trap builtin is also present in bash): gnome-terminal --tab -t "FOO" -e "zsh" \ --tab -t "XYZ" -e "zsh -c 'trap \"zsh\" 2; tail -f /var/log/dmesg'" Or: gnome-terminal --tab -t "FOO" -e "zsh" \ --tab -t "XYZ" -e "zsh -c 'trap \"zsh\" SIGINT; tail -f /var/log/dmesg'" It looks like you're running this from sh. Some side notes: ...


0

Using dialog, the command would look like this: dialog --clear --backtitle "Backtitle here" --title "Title here" --menu "Choose one of the following options:" 15 40 4 \ 1 "Option 1" \ 2 "Option 2" \ 3 "Option 3" Putting it in a script: #!/bin/bash HEIGHT=15 WIDTH=40 CHOICE_HEIGHT=4 BACKTITLE="Backtitle here" TITLE="Title here" MENU="Choose one of the ...


-1

#!/bin/bash # "Two Words" Makes It Count As One Object, # But If It Is A Single Word,You Don't Need The "" select choice in "Start Server" "Update Server" Exit do case $REPLY in 1) echo Start Server... ;; 2) echo Update Server... ;; 3) echo "Okay, Exiting..." exit ...


0

What you can try is rejecting all packets using firewall rule accept all packets within your network, when you want things normal just remove this firewall rule, make a script and run with cron. For more refer https://help.ubuntu.com/lts/serverguide/firewall.html, I have not tried this yet but will try it later. Let me know if you try it before me.


4

Removing your default gateway should do the trick, you'll still be able to reach everything in your subnet, but not outside of it. IIRC this should work, cannot try it atm, replace the IP with your routers IP (in the same subnet): sudo route del default gw 192.168.1.1 Edit: To undo it, this should work: sudo route add default gw 192.168.1.1 To find ...


0

The missing file is part of the package libssl-dev. Therefore install it via sudo apt-get install libssl-dev


0

Just extending\simplifying previous 'stat' related answers: You can simply run: stat <path_to_file> The output will contain octal permission along with other info. Details(stat version and example): # stat --version stat (GNU coreutils) 8.4 [user@localhost ~]# touch /tmp/TEST_PERMISSONS [user@localhost ~]# chmod 644 /tmp/TEST_PERMISSONS ...


2

/usr/local/bin/ should already be in your $PATH so there's nothing to do. Simply use lessc like you would any other command. Here's a little snippet showing mine is installed like yours, and it parsing some LESS into CSS. $ sudo npm install -g less ... npm installs less ... $ which lessc /usr/local/bin/lessc $ lessc - <<< 'a{color:white; strong ...


0

look for nautilus-admin package (search in synaptic-packet-manager )...and try to install it maybe will fix your problem credits to : https://bitbucket.org/brunonova/nautilus-admin


1

DISCLAMER: The following java answer is for educational purposes and the fun of coding only. If you downvote, explain in the comments why. Code The code bellow reads each line from /etc/passwd , splits that line into strings with : as separator, and sorts users depending on their UID into appropriate ArrayLists. package com.askubuntu.users.serg; import ...


1

The problem is that ! -path "/main/videos/internal/file/Secure/*" will avoid subdirectories under /main/videos/internal/file/Secure/ only, not any other Secure directory in the hierarchy involved here. For example, /main/videos/internal/file/foobar/Secure/spam.MOV will still show up in the output. So if you want to exclude all Secure directories (and ...


0

Try: dpkg-query -W libgtk-3-bin # Gives version as 3.10.8, separated on the left by a tab, and on the right by a ~ $ dpkg-query -W libgtk-3-bin libgtk-3-bin 3.10.8~8+qiana # An associated package also gives the package architecture [for me] $ dpkg-query -W libgtk-3-0 libgtk-3-0:amd64 3.10.8~8+qiana


2

Mind that this will copy also folders containing just folders, and not just folders containing at least one file. Not sure if that's exactly what you're looking for; in any case I'll leave this in case it could be useful to someone else. Using find: find source -mindepth 2 -maxdepth 2 -type d -not -empty -exec mv {} target \; source: searches in source/ ...


0

Try this: cp -r /folderA/folderA /newdestination/ Command cp copies files or directories, and here is followed by -r, which recursively copies child directories in your destination. Pay attention to slashes after path or their absence. More on copying here.


0

If you're running Ubuntu on a Chromebook with crouton, the only one of the answers that will work is going to chrome://gpu in the Chrome browser.


-1

YADR is not meant to work in ubuntu., you may wish to try an ubuntu variant, such as : https://github.com/renoirb/ubuntu-yadr



Top 50 recent answers are included