Tag Info

New answers tagged

0

You can use the --exclude field in your grep command like so: grep --exclude=myfile -Eron r"%}(.*){%" > myfile


5

To apply the changes to your current shell you need to "source" it and not to "execute" your script. So, if your script is called "script.sh" then instead of executing it as ./script.sh, source it with . ./script.sh and your changes will be applied to the current session.


2

I had the same problem and finally solved it by using an alias in my ~/.bashrc alias chlang="export LANG=en_US.utf8;export LANGUAGE=en_US.utf8;export LC_ALL=en_US.utf8"


5

It seems normal. The change are only applied in the local shell session (ie the one which run the script), the parent shell are not affected. If you run command in your current shell you are affecting your current shell, if you put it in your .bashrc then it also affects your current shell at startup. But when you put it in a script a new shell is ...


0

The desired functionality doesn't require setting up trust between two machines. Also, this, as you properly mentioned, is not recommended from the security point of view. What you likely want to do (if you want a password-less) login to the remote server is the following: on your local machine under your user generate a passphrase-less key using ...


8

You're asking to change directory to the script: cd /home/lanein1/scripts/rename1.sh >> /home/lanein1/scripts/rename2.log 2>&1 Perhaps you meant to run it: /home/lanein1/scripts/rename1.sh >> /home/lanein1/scripts/rename2.log 2>&1


0

last | grep -i Mon (although the -i option shouldn't be needed if you capitalize "Mon" as I have it) Your proposed solution has a few problems: The pipe | symbol sends (pipes) the standard output of the first program (on the left) to the second program (as standard input). So what you're doing is trying to pipe the output of grep -i /var/log/wtmp to last ...


0

last | grep Mon | awk '{print $1}' | sort -u


0

Since starting to study Arabic and also having to process it in scripts, etc., I keep trying out new text editors as I encounter them. However, and I'm clearly very opinionated here, Gedit beats them all. Hands-down. With most text editors something isn't just quite right, but with Gedit everything just works the way you'd expect it to. One small gripe is ...


2

The third part of the version number is incremented for bugfix releases. 14.04.3 is the same Ubuntu release as 14.04, just with some bug fixes applied. The important part here is “Release: 14.04”, and to do security and bugfix updates in a timely manner. Once in a while, Ubuntu collects the security and major bug fix updates that have been performed so far ...


1

dpkg -L haskell-platform-doc will list the files installed by that package for you. However, this is a meta package, it does not install much content itself, but pulls in other documentation packages as dependencies. So issue dpkg-query -f'${Depends}' -W haskell-platform-doc to find the dependencies, and use dpkg -L with those. You should expect ...


0

After a little rooting around I believe your DISPLAY variable is incorrectly set. According to the user at Is there a command to list all open displays on a machine? :10 is normally used for SSH forwarding, but not a local session. You are able to list your available displays using ls /tmp/.X11-unix/ You should see X0 among them, if so set your display ...


2

Gmail Setup In gmail, go click the gear icon, go to Settings, go to the tab Forwarding POP/IMAP, and click the Configuration instructions link in IMAP Access row. Then click I want to enable IMAP. At the bottom of the page, under the paragraph about configuring your mail client, select Other. Note the mail server information and use that information for ...


2

#!/usr/bin/env bash countdown() { i=$1 while [ $i -gt 0 ]; do printf "Starting in %d...\n" $i sleep 1 i=$(( i - 1 )) done } countdown 3 Now, if you want to be fancy, tput might be worth looking into: tcountdown() { i=$1 clear while [ $i -gt 0 ]; do tput cup $(( i - 1 )) 40 printf $i sleep 1 i=$(( i - 1 )) done ...


1

Opening the URL directly in a web browser gives this more informative error message The requested URL /ubuntu/dists/saucy-security/universe/binary-i386/Packages was not found on this server. From this it's a short step to checking whether Saucy still exists. Looking at http://releases.ubuntu.com/ it's possible to see that it's not mainline, but that ...


0

As mentioned in another answer, the problem is that invoke-rc.d nginx rotate returns an error stating that the rotate action is not supported. The interesting thing is that service nginx rotate works without issues. My guess is that the invoke-rc.d wrapper doesn't support all the actions the actual nginx init script supports. Changing invoke-rc.d nginx ...


0

Key boards are designed with a matrix pattern of rows and columns. The keyboard has a micro-controller that scans those rows and columns to see what button(s) are pressed. Your best bet is to pull the keys and (I'm assuming) the rubber membrane and clean it and the board with rubbing alcohol. Looks like a hardware issue to me.


3

Simply start the command with the -i switch sudo sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config From man sed -i[SUFFIX], --in-place[=SUFFIX] edit files in place (makes backup if extension supplied). The default operation mode is to break symbolic and hard links. This can be changed with ...


0

After disabling IPV6 on the remote machine I received the message org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed] when using command ssh -X ub-dev /opt/eclipse/eclipse. To fix on Ubuntu 14.04 I added line AddressFamily inet to file /etc/ssh/sshd_config and restarted ssh sudo service ssh restart.


5

There is no default password. You can set a password for your user with sudo passwd openemm It will prompt you for the password twice.


1

If you like to time commands for performance reasons, I recommend not to use /usr/bin/time but either ptime(1) if this available on your platform - ptime gives a nanosecond resolution - or to use a recent Bourne Shell, as the Bourne Shell allows to automatically time all foreground commands (including shell builtins) with a microsecond resolution on all ...


5

The structure of a pipeline doesn't allow time in the middle, only at the start of the pipeline. Also, time is a "shell keyword", as shown by type time. But nothing forbids the use of compound commands (and time each): time comm1 | ( time comm2 ) So, you could workaround using a sub-shell, like this: echo "12" | ( time python3 -c "a=input("");print(a)" ...


2

I used to have a "no internet" update process on my machine. This is how I did it: First I used apt-get --print-uris update > meta.list to create a list of all files needed for updating the system. Using wget, I could run wget -x -i meta.list on any other machine to download the meta data on a USB stick. Back to my machine, I generated the list of files ...


9

This sounds like it may work, but personally, I'd just use apt-offline. From the manpage: apt-offline brings offline package management functionality to Debian based system. It can be used to download packages and its dependencies to be installed later on (or required to update) a disconnected machine. Packages can be ...


3

There is two types of time commands. One is shell built-in, belongs to bash. That's the one you see in your first example. Second one , is /usr/bin/time, that's the second one you saw. As for why it's different output, it's because you cannot pipe output to shell builtins. More on that here


0

I have my keyboard configuration from Debian Jessie. it's not working out of box for Arch, too. After having a quick look at /lib/udev/hwdb.d/60-keyboard.hwdb, I found replacing: keyboard to evdev:atkbd works for me.


0

You used the same key binding to try to do different things: the correct ones are: gsettings set org.gnome.desktop.wm.keybindings switch-applications "[]" gsettings set org.gnome.desktop.wm.keybindings close "[]"


0

I thought the 'standard' variant of Ubuntu was using the Unity desktop environment and Ubuntu Gnome was one of the official flavors sponsored/recognized by Canonical. I do not have the usage stats handy but use Ubuntu Gnome as the sole OS on a MacBook Air (2014 mode year) and like it very much. Gnome is, if I remember correctly, is lighter than the ...


1

"standard" Ubuntu is the GNOME version. There's Xubuntu (XFCE), Kubuntu (KDE), and Lubuntu (lightweight). This only affects the initial set of packages that gets installed. After install, you just have an Ubuntu system configured to start one or the other graphical desktop by default. Kubuntu for example installs the kubuntu-desktop meta-package (which ...


0

The wireless icon shows if you have a wireless card connected. I can hide it by right clicking on it and uncheck Enable Wi-Fi Maybe NetworkManager isn't managing the connection. If it's the case see this page. Try to remove the current profile for your Ethernet connection and create a new one. It can be any wrong configuration.


0

I know about this problem. And as usual, the culprit is widely deemed to be nouveau, the GPL NVidia driver. @Vesnog, may I guess that your friend has a GeForce card built into his PC? That would explain a lot. :) Ah, and since you're on Ubuntu, the following line might cure the "problem" as well ;-) $ sudo apt-get remove light-locker This thing is really ...


0

You can take a look at Watchdog (https://github.com/gorakhargosh/watchdog/) to keep all your logic in python, you could watch the directory and move each file after a minute without modification. The other solution is to use rsync to transfer all files from find output instead of constructing with -exec. A little explanation: find ... -exec ... \; -> This ...


1

One performance improvement could be achieved by using the + ending with the -exec action of find which will cause -exec to be forked only once. While in case of ;, the -exec will be forked each time for a new argument. So you can use : find path -type f -name '*.cdr.xml' -mmin +1 -exec mv -t /path {} + If there is a chance of duplicate file names : ...


3

Yes. Recoll can regularly index your files and provide a search via your browser. It can search within files too. Recoll is a full-text search tool for Unix and Linux desktops. Recoll finds keywords inside documents as well as file names. It can search most document formats. You may need external applications for text extraction. It can ...


1

The auditd subsystem watches system calls, and the NFS clients are making system calls on their respective hosts. (So auditd cannot detect system calls on hosts other than itself.) To monitor the events of the clients, configure auditd on the remote hosts. Use the audisp-remote plugin on these hosts to send audit-related messages to a central logging host ...


0

Emacs has an extension called Org mode (Ubuntu: org-mode) which does, errrm, stuff, including agenda facilities. The Org mode agenda can be synchronized with Google Calendar, though it appears not to be foolproof; see the Org mode Google Calendar Synchronization tutorial, and try org-caldav or org-gcal (both installable with M-x package-install in Emacs). ...


1

Take a look at: gcalcli, and also: remind , which has PHP scripts to convert iCAL entries to Remind format.


0

netstat as shipped with modern OSes (including Ubuntu) has a -W (--wide) switch that disables column width restrictions. This is definitely present since net-tools 1.60-23, documented in netstat(8), and listed in Changelog as an addition to 1.60-22. Old releases of net-tools, such as net-tools 1.60-10 (about 2005), don’t have this feature. For those who are ...


1

The issue is fixed now. seems to be an issue with Discourse SSH container configuration, In /etc/ssh/sshd_config PermitRootLogin without-password I've changed it to PermitRootLogin yes #PermitRootLogin without-password That fixed the issue.


0

You should use code markup for pasting in a log file, but from what I can tell: sshd[32711]: debug1: PAM: password authentication failed for root: Authentication failure Aug 26 20:32:29 Seems relevant. Are you sure you are using the correct password for the root user of your docker image? Also, did you restart the sshd service (in the docker image) so ...


1

I wouldn't do this at any kind of web server connected to the internet, but if it makes you happy, try to access samba as root instead of your user account. Create a password for user root and try to connect to your share with that: smbpasswd -a root Best log out of windows and log back in, AFAIR windows only supports one authentication connection to a ...


1

To install the libSBML package in Ubuntu 14.04, first install the Python development packages and the Pip install system: sudo apt-get install python-dev python-pip Then install the libSBML dependencies and development libraries: sudo apt-get install libxml2 libxml2-dev sudo apt-get install zlib1g zlib1g-dev sudo apt-get install bzip2 libbz2-dev ...


2

To start your service at the end, run this command update-rc.d homemadeserviceName defaults 99 This will add a link inside /etc/rc.d as, S99homemadeserviceName Upstart will start services in the order of their numeric suffix... S0, S1, S2... and finally S99 services.


0

The kernel module virtio_console is needed. The VM was using the -virtual kernel, I switched to -generic and now it's working!


0

Perhaps a more simpler way to accomplish what you need, is to use the -f [filename] option provided in bash and load all the environment variable needed from that alternative rc file. The source buliten (built in function) was not meant to function the way you're using it here. The ". , include, and source bulitens were meant to include library (reusable ...


-2

sh install.sh or bash install.sh to execute your script in a terminal


4

If you want to program a bash script, then change your shebang (first line of the script file) to #!/bin/bash


1

There are two parts in this. One is the grub part which is hidden by the boot screen. You can enable its output for textual consummation by changing the line GRUB_CMD_LINE_LINUX_DEFAULT in /etc/default/grub on Ubuntu machines and remove quiet splash: #GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX_DEFAULT="" run update-grub after this for ...


0

In ~/.ssh/config have something like this: Host server1 HostName server1 ForwardX11 yes User username


3

You don't need (and don't want) xhost +. Just update (or create) your .ssh/config file with the following for the equivalent of -X: Host * ForwardX11 yes Or for the equivalent of -Y: Host * ForwardX11Trusted yes This will affect your connections to all hosts. You can of course use something other than * to limit these configurations changes to ...



Top 50 recent answers are included