Now, I have a simple file that runs every time I open my Gitpod(cloud env). I am making a file so that I can access it via ngrok. But, I need some packages, like wget, unzip and neofetch(for my ease). But it opens in a different terminal and I have to enter y every time. Is there a way to put y in the command and it will install automatically?
Source code for the file:
#!/bin/bash
sudo apt update
sudo apt install wget unzip openssh-server neofetch -y
sudo service ssh start
echo "Set Password for Gitpod as gitpod"
sudo passwd gitpod
wget "https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip"
unzip "ngrok-stable-linux-amd64.zip"
echo "I need your ngrok auth token. Enter it below."
read -p "ngrok authtoken:" authtoken
./ngrok authtoken $authtoken
echo "Authtoken activated, now activating server..."
./ngrok tcp 22
sudo apt install wget unzip openssh-server neofetch -y
Have I put correctly in this line? If this works, whenever I get a cloud environment, it could just install all deps and go ahead.
Output:
NOT an answer, an output.
The fish shell I like and use's output:
Welcome to fish, the friendly interactive shell
Type `help` for instructions on how to use fish
gitpod#ws-588be66f-373e-46f0-8342-5d39b8c863f4 /w/coder-lg-blog-codedoc (master)> sh .gitpod/ngrok.sh
Hit:1 https://download.docker.com/linux/ubuntu focal InRelease
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:4 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease
Hit:5 https://deb.nodesource.com/node_16.x focal InRelease
Hit:6 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:7 https://apt.llvm.org/focal llvm-toolchain-focal InRelease
Hit:8 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
107 packages can be upgraded. Run 'apt list --upgradable' to see them.
.gitpod/ngrok.sh: 5: y: not found
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Yeah its a cloud Gitpod env for my blog and I want SSH tunneled via ngrok but it says this:
/repo > .gitpod/ngrok.sh: 5: y: not found
How can I fix this? The mod deleted the last output so please don't delete this! It is mainly an output of the Gitpod Terminal.
You can add an echo command in your script and use this as a standard input for your next command.
echo y | [next-command]
Please don't delete.
By #Biffen and this is the solution!
That error doesn’t look like the result of the code in the question. Are you running the strange suggestion in one of the answers; | y? That won’t work. Have a look at this.
Thanks to everyone who helped here, and I am marking this as answer, because Biffen's reply was a comment.
Edit: In 2 days as of now, I can mark this as answer, because, Stack Overflow said so.
Related
Few weeks ago I tried to install an IDM replica on Ubuntu 20.04 from Focal. However I got an error and from ever since, whenever I run "Sudo apt update" the same error returns.
Err:17 http://ppa.launchpad.net/noobslab/apps/ubuntu focal Release
404 Not Found [IP: 91.189.95.85 80]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/noobslab/apps/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Screenshot of the terminal
sudo apt clean
cd /var/lib/apt
sudo mv lists lists.old
sudo mkdir -p lists/partial
sudo apt update
I am a traditional Windows user and therefore you have to excuse me for my lack of experience with other OS. I installed Ubuntu in order to install FSL in my computer (seems the Windows installation failed so I tried this). However, the download goes right, but at the end it says "[FAILED] Unable to unpack FSL".
How can I solve it?
Thanks a lot
First of all, this is not a programming question. If it can still be moved to AskUbuntu (or SuperUser) it may be better appreciated.
In Ubuntu the easy way to install software is through the package manager. This is by far the least amount of work and installs binary packages in default locations (FSL is in the path straight away), plus it takes care of all the dependencies!
FSL is in the NeuroDebian repository, and if you add this to one of your 'software sources' then you can install it via Ubuntu's package manager, APT:
go to https://neuro.debian.net and find out how to add the right repository, e.g.
$ wget -O- http://neuro.debian.net/lists/focal.de-fzj.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
$ sudo apt-key adv --recv-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9
update the list of packages APT can find:
$ sudo apt update
install the fsl packages you want, e.g.
$ sudo apt install fsl-5.0 fsl-harvard-oxford-cortical-lateralized-atlas
During Debian (buster) installation, I got a message telling me that the files
iwlwifi-5000[1-5].ucode were needed. I first finished installing without the files.
Then, after reading this related page:
https://packages.debian.org/buster/all/firmware-iwlwifi/download
I have added the following line to the file /etc/apt/sources.list
deb http://ftp.debian.org/debian buster main non-free
but when running the command:
aptitude search iwlwifi
I don't get any result.
Did I forget something or did anything the wrong way?
A stupid mistake for those often using aptitude or apt.
I had forgotten to run:
aptitude update
after modifying the file /etc/apt/sources.list
Hoping this will be useful to someone.
I want to use selenium-webdriver with chrome or firefox in precise 64 bit box.
At first I must install firefox, so I followed this instraction.
http://www.installationpage.com/selenium/how-to-run-selenium-headless-firefox-in-ubuntu/
I added ppa:mozillateam/firefox-stable to /etc/apt/sources.list, then sudo apt-get update.
But then I got this error.
E: Type 'ppa:mozillateam/firefox-stable' is not known on line 2 in source list /etc/apt/sources.list
E: The list of sources could not be read.
I also tried add-apt-repository but it fails with command not found error.
How can do to install firefox to precise64? Or is it better if I use another box for using selenium webdriver?
Installing firefox will cause a lot of dependencies to be installed, .e.g X and a desktop environment or at least a light weight WM.
In fact, 12.04.4 LTS already has firefox 28.0 in its official repository, you don't have to add a PPA to get the latest stable, just do sudo apt-get -y install firefox and it'll do.
BTW: You are getting the error because it's not the correct line(s) to be added in sources.list or split files under /etc/sources.list.d/*.list
it should be like below:
deb http://ppa.launchpad.net/mozillateam/firefox-next/ubuntu precise main
deb-src http://ppa.launchpad.net/mozillateam/firefox-next/ubuntu precise main
To use add-apt-repository command, you'll have to install python-software-properties beforehand.
I need to update the kernel timer on my Ubuntu Lucid (10.04) server on EC2 (with EBS) from 250HZ to 1000HZ, to improve voip call quality.
From what I've read, the way to do that is to download the kernel source code, configure it, then install it.
I've found several decent tutorials that are fairly specific to my setup, the best of which are:
https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel
https://help.ubuntu.com/community/Kernel/Compile
http://blog.avirtualhome.com/2010/05/05/how-to-compile-a-ubuntu-lucid-kernel/
http://crashcourse.ca/introduction-linux-kernel-programming/intermission-building-new-ubuntu-1004-kernel-free-lesson
That's led to me to the following sets of commands, which all run nicely, making the .deb files with no obvious errors. But then when I restart the server the timer frequency hasn't been updated.
sudo apt-get build-dep linux-image-$(uname -r)
sudo apt-get build-dep linux
sudo apt-get install fakeroot build-essential
sudo apt-get install crash kexec-tools makedumpfile kernel-wedge
sudo apt-get install libncurses5 libncurses5-dev
sudo apt-get install libelf-dev asciidoc binutils-dev kernel-package
cd /usr/src
sudo apt-get source linux-image-$(uname -r)
cd linux-*
sudo make menuconfig
# Processor type and features -> Timer frequency -> change to 1000HZ -> Exit -> Exit -> Yes (Save)
fakeroot debian/rules clean
fakeroot debian/rules binary-headers
fakeroot debian/rules binary-indep #This does the headers, docs, and source
#check deb 2-3 files were created
cd ..
ls *.deb
sudo dpkg -i linux-*.deb
#reboot
EDIT
Spent some time with jjohansen on irc #ubuntu-kernel, and was able to find my mistake with his help - looks like I should have done the configuration step in between the clean and build. Also, he recommended to always use the source from git rather than the package, so these are the new commands to do in the middle of what I had above:
cd /usr/src
# This is 700mb so it takes a while to download and set up
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-lucid.git
cd ubuntu*
git checkout --track -b ec2 origin/ec2
fakeroot debian/rules clean
fakeroot debian/rules editconfigs
fakeroot debian/rules binary
#Takes about 40min
John Johansen (kernel hacker at Canonical) believes that you should be able to build and run your own kernel on an EC2 instance with Ubuntu.
See jjohansen's notes in this 1000Hz EC2 kernel request I had submitted back in 2009:
https://bugs.launchpad.net/ubuntu-on-ec2/+bug/365233
You will want to make sure that you are starting with a recent Ubuntu AMI that uses pvgrub.
Thanks to Eric Hammond for the heads up,
Which kernel you are going to need will depend on which version of Ubuntu you are using. For Lucid - Maverick you will need to use the -ec2 kernel source. The support needed was moved into the regular kernel tree for natty and oneric.
So you will need to do
sudo apt-get source linux-ec2
or
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-lucid.git
cd into the source directory
fakeroot debian/rules clean
fakeroot debian/rules binary
For Lucid you will also have to make sure you have a done an update or are using a current image, as support for pv-grub was add after Lucid was release.
Referencing Redzarf's terminal commands including his edit plus a couple small necessary additions, heres what worked for me on a Amazon ec2 vanilla install of Ubuntu Server Cloud Guest 10.04 LTS (Lucid Lynx) 64x
# Make yourself root
sudo su
# Update source list:
aptitude update
# Upgrade everything:
aptitude upgrade
# Install dependencies:
apt-get build-dep linux-image-$(uname -r)
apt-get build-dep linux
apt-get install fakeroot build-essential
apt-get install crash kexec-tools makedumpfile kernel-wedge
apt-get install libncurses5 libncurses5-dev
apt-get install libelf-dev asciidoc binutils-dev kernel-package
apt-get install git-core
cd /usr/src
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-lucid.git
cd ubuntu*
git checkout --track -b ec2 origin/ec2
fakeroot debian/rules clean
fakeroot debian/rules editconfigs
# Configuration window should now appear, do the following:
Select YES
# Navigate to:
Processor type and features -> Timer frequency
# Select the 1000HZ frequency
Exit
Exit
Yes (Save)
#After saving and returning to prompt it may ask you to do it again for i386, select yes and repeat!
# Recompile:
fakeroot debian/rules binary
#Check if your deb 2-3 files were created
cd ..
ls *.deb
sudo dpkg -i linux-*.deb
#reboot
reboot
#Check your new Kernel version
uname -r
#Check if Kernel HZ value change persisted:
cat /boot/config-`uname -r` | grep HZ
#If value 1000HZ=yes:
Done!;)
--===< Quick Tip >===--
If your running an "on-demand micro instance", compile time will take approximately 7hrs and cost around $0.14!
If on the other hand you want to save yourself some time and recompile in just under 12min for $0.21, you can do this:
Reserve a High-CPU Extra Large Spot Instance (20x ec2 compute units, 7GB ram)
Recompile your kernel with aforementioned commands (12min)
Once recompile completes take a snapshot of the spot instance's ebs volume
Wait for Snapshot to complete (few minutes)
Terminate the spot instance
Create new volume from the snapshot (nichname: Volume X) also take note of the volume ID!
Go to Instances > Create your New EBS Instance
This will be the New instance your Asterisk server will be running on
It must be from the same Base AMI, and same Zone as Volume X)
-The New Instance will now be created along with a corresponding EBS Volume
Stop the New instance
Go to Volumes > Detach the New instance's corresponding EBS volume
After it's detached, delete that volume
Select Volume X > Attach to New EBS Instance (Device ID Must be: /dev/sda1)
Go to Instances > Start your New Instance
Re-associate your Elastic IP if you had one.
Check if everything works
If everything checks out, create another snapshot for backup!
Done! ;)
Big shout out and thanks to Redzarf, Eric Hammond, and John Johansen!
Your second best guess is correct. Amazon's way of booting Linux kernels is special to their domain, and it is indeed as you mentioned - based on a special version of grub. They have published resources on the matter, please read Enabling Your Own Linux Kernels.