problems with ubiquity/success_command Ubuntu 14.04 - automation

I want to automate the Ubuntu installation (a fully unattended installation without questions). I also want to run a script right after the installation is finished.
What I did is that I managed to have a fully unattended Ubuntu installation. I am doing this by providing a pre-seed file and using boot parameters to preseed the questions that are asked before the preseed file is loaded. The installation went okay but the problem lies with running the script right after the installation completion. I am using Ubuntu 14.04 LTS desktop version thus I am not using the late command as I have read that it won't be noticed by the installer. Instead, I am using the Ubiquity/success_command. I have the following code at the end of my pre-seed file.
ubiquity ubiquity/success_command string \
mkdir /target/dev-master/; \
cp -r /cdrom/dev-master/* /target/dev-master/; \
chroot /target bash /dev-master/SCRIPT;
The problem is nothing happens. I think the command went unnoticed as well.
I am not sure if I am approaching the problem correctly.
What am I doing wrong ?
Is there any other alternatives that might provide the desired result ? Any help would be appreciated and thanks.

Related

WSLv2 mount option missing from wsl util

I'm using wslv2 on Windows 10 Pro running on the dev channel. I've made sure it's fully up to date, then completely uninstalled wsl and ubuntu, then reinstalled them.
Despite this, I don't have a working mount option :(
wings#machine:~$ wsl --mount
Unknown command: --mount
If I understand correctly, you are trying to do this from the wsl terminal. But this must be done through powershell.
This is due to the --mount option being not yet released.
The documentation on Microsoft doesn't highlight it very much but you have to use early windows 11 preview to be able to use the mount option.
See here: https://learn.microsoft.com/en-us/windows/wsl/wsl2-mount-disk#prerequisites
From what I understand there, the actual release is scheduled for this month (Sept. 21) in Win 10.

Chmod from IntelliJ on Windows?

I'm using PyCharm on Windows. How can I set executable bit or modify other permissions like Linux chmod? I found this only and nothing suitable in plugins but still hope there's a better solution then switching to Linux console for that purpose.
I ran into the same issue, but I wasn't very eager to install yet another plugin. If you happen to use Git, you can do it from PyCharm's terminal using the following command:
git update-index --chmod=+x path-to-your-file

Gnuradio companion not installed after running build-gnuradio script

I tried installing Gnuradio 3.7.9.2 using build-gnuradio script and apart from a few hiccups due to some packages (which I installed and re-ran the script again) , the script completed its run successfully (I enabled the verbose option of the script to check the output). I even added the PYTHONPATH to the .bashrc script after completing the installation. When I tried launching gnuradio-companion though, it doesnt recognise the command.
:~$ gnuradio-companion
The program 'gnuradio-companion' is currently not installed. You can install it by typing:
sudo apt-get install gnuradio
So, I was wondering whether I need to install grc separately after the build-gnuradio script installation ?. I apologise if this is too simple, I have tried the installation many times and searched the web for problems like this. To the best of my efforts, I was not able to find any. It would be great, if anyone can point to any existing question similar to this, or guide me in fixing this issue. Thank you.
It is advised to use PyBOMBS to install GNU Radio. Installing Out-of-Tree modules (OOTs) will be much easier afterwards. As for your problem: Did you check if your $PATH variable (echo $PATH) contains /usr/local/bin/? This should be the default installation path for a non-system install of GNU Radio.
Alternatively you can try to run /usr/local/bin/gnuradio-companion.

Apache Web Development on Cygwin

I'm trying to get an Apache server running on my Cygwin setup to follow the Java Ranch Cattle Drive tutorials online (basically, to learn Java EE web page development that uses a MySQL back end.)
I used the Cygwin Setup program to install httpd (which is how I installed most other dev tools I use on cygwin) and it says install complete, yet when I run 'httpd' it cannot find the command. It also appears the expected install directory (/usr/local/apache...) doesn't exist.
Does anyone have any experience using this setup, and if so, you could walk me through the initial steps of getting the server up and running and getting a browser to display the server's default page?
To keep answers focused, I didn't want to discus the drawbacks of running Apache on a Windows system - this is just for learning purposes. Thanks in advance.
Looking at the Cygwin Package Listing for httpd, you can see that the executable is installed under /usr/sbin.
So, if /usr/sbin is not on your PATH (it isn't on mine, not by default anyhow), you would actually run:
/usr/sbin/httpd
And btw, if you would like to list the files installed for a certain package, you can use cygcheck:
cygcheck -l httpd
cygrunsrv -I Apache -p /usr/sbin/httpd -a "-X"
This will solve the problem. This assumes you already have cyrunsrv set up. The reason httpd fails with cygrunsrv if you leave out the -X is that the process disconnects from the terminal and cygrunsrv considers that a failure. The -X option for httpd is the debug or terminal mode.
I couldn't find any detailed information on how to get Apache working on Cygwin, so here it is if someone's interested:
Install the httpd-* and httpd-mod_* packages you need. Note that the packages named "Apache" are deprecated. You need the ones named "httpd" (which are actually Apache).
Install cygrunsrv (normally this is a default Cygwin package)
Run /usr/bin/cygserver-config as admin. This is needed because Apache requires an IPC server running.
Open services.msc, then go to the CYGWIN Cygserver. Right-click on it and start it. If you don't do this, you'll probably get errors like "AH00023: Couldn't create the proxy mutex".
Finally, start Apache by running /usr/sbin/apachectl restart
Config is in /etc/httpd/.
Some information about running Apache on Cygwin:
http://httpd.apache.org/docs/1.3/cygwin.html
http://www.issociate.de/board/goto/895433/apache2_does_not_start_in_cygwin.html
http://www.cygwin.com/ml/cygwin-apps/2005-02/msg00085.html
Personally, I would recommend installing WAMPServer or other WAMP stack and do it that way. There is no difference, except that you'll need to control Apache through Windows commands [net start, net stop], not Cygwin's ones.

IntelliJ - Running Program as Sudo

Developing a program on OSX using Java and IntelliJ. Deals with network sockets and ICMP. Hence, the program needs to be run as root or sudo'd on OSX. Program runs fine from a terminal window outside IntelliJ under sudo. However, I would like to debug and run it from IntelliJ (V9). In IntelliJ it errors (I need root privs to enumerate network devices). I know how to pass program and VM parameters in IntelliJ but now how to hit Run and/Debug and have it run under sudo? What is needed is basically sudo java ...... MyProgram instead of java ..... MyProgram Any ideas or workarounds.
I came out with an answer and wanted to share it just in case anyone else runs into this. To solve the problem, I took my cue from what I do with QT & QT Creator when doing network programming.
On OSX, I opened up a terminal window and cd'd down to/Applications/IntelliJ IDEA 9.0.3.app/Contents/MacOS. There you will find a file called idea which launches the IDE. I ran that as sudo (sudo ./idea). That took care of permissions on anything Intellij launched and I could debug and step through my code as needed.
sudo /Applications/IntelliJ IDEA 9.0.3.app/Contents/MacOS/idea
Since this is a dev machine and I am in control of it security is not an issue in this case.
Hope it helps someone else out.
Inside a terminal:
sudo -s
give access to the root user.
from there you could run the Idea IDE using the script:
/Applications/IntelliJ\ IDEA*/bin/idea.sh
and in this way I'm able to work on network where permission errors where printed before.
Debugging of sudo programs is disallowed by the operating system unless the debugger is running as root, for security reasons.
So, even if you can figure out how to get IntelliJ to use sudo it won't do you any good.
I know this is not what OP directly asked -
In case someone needs to do this on Linux (Ubuntu), e.g. in order to update Idea, just run from command line:
sudo /usr/local/bin/idea
Only make sure once the Update and Restart is finished to actually close Idea and start it normally
I agree with #Darron, it is not recommended to execute IntelliJ with sudo.
You can execute with IntelliJ terminal instead.
I maintain my project in IntelliJ. When I need to execute a unit test that requires sudo access, I just open IntelliJ terminal and type:
sudo gradle test
Good luck!