Custom Cygwin distribution? - cygwin

Is there anyway to create a Cygwin distribution that has customized packages? In other words, can I just zip up my cygwin folder and unzip it to another computer for it to work straight away?
Or are there registry\path configurations that would only bet set correctly by running the setup.exe?

I'd browse the Cygwin Archives to answer this question.
(added after Bei337's first comment)
I believe the Cygwin FAQ answers your question.

You can archive (e.g. zip, 7-zip etc.) the contents of the cygwin directory and it'll work on another computer after unarchiving if you make sure that cygwin.bat contains the correct paths.

Related

Where do I put sublime_text_3

I just unzipped sublime_text_3_build_3143_x64.tar.bz2 and have a nice copy of the sublime_text_3 directory in my downloads folder.
Where is the right place to put this file in Centos? Maybe somewhere in /user/local/?
Also do I create a link to the executable or set a Path?
Just looking for favorite (best?) practices.
As has been pointed out in the linked article in the question comments, /opt is preferred by some, and in fact according to this answer, /opt is where you would locate "unbundled packages". Of course, it also goes on to say that these sorts of packages should also package the binary in a bin subfolder, which Sublime does not, for what that's worth.
If you want to follow best practices, that's probably where you should place the folder. If nothing else, I would assume that any Linux OS that has a package manager for doing upgrades is going to stay well clear of /opt based on what it's used for, which will make sure that something untoward can't happen.
As to whether you would create a symlink or add that folder to the path, I'm not so sure. My own personal philosophy is that the PATH isn't something that needs to have an entry for every application that I install.
My own recommendation would be to create a symlink somewhere that's already in the path and you're good to go. The linked article mentions putting the link in /usr/bin. The Filesystem Hierarchy Standard says of this path:
This is the primary directory of executable commands on the system.
I would take from this that this is an acceptable path to put the symlink in.
In the end, it doesn't matter to Sublime where the folder is placed, since it determines the location of the shipped packages based on where it's binary is located, and the configuration information is always in a known place.

Set a Windows exe icon from Linux (without Wine ?)

I'm trying to set a Windows executable icon with a Bash script in Linux, but I can't find anything relevant.
I have found this tool www.nongnu.org/icoutils, but it seems to me that you can only extract .ico file from the executable (then convert it into png), or do the opposite: it takes pngs and it creates an .ico BUT it can't write the new ico into the executable.
Am I right or wrong ? What should I do ?
By the way, I've found this thread and this one, but they do not fully answer the question...
Thanks !
One way would be to use Resource Hacker with wine.
Therefore,
install wine
download Resource Hacker
install Resource Hacker with wine (or wine32 if you are on 64bit):
$ wine32 /path/to/reshack_setup.exe
change icon:
$ wine32 .wine/drive_c/Program\ Files/Resource\ Hacker/ResHacker.exe -addoverwrite "oldexe.exe,new.exe,new.ico,ICONGROUP,MAINICON,0"
This worked for me on a few .exe files. It also failed on one, i don't know why.
Hope this helps!

How to set up LIBSVM Matlab interface?

I am having problem with implementing LibSVM to MATLAB.
I am using MATLAB R2009a (I also have the latest version, R2012b, but I dont use that one)
I downloaded LibSVM package, libsvm-3.14 to my Windows 7 PC, which MATLAB and OCTAVE interface come together.
I extracted the folder I downloaded. Which, below, you can see the printscreen of what the folder has in.
Where should I put my libsvm-3.14 extracted folder ? Should I put it under "bin" folder of my MATLAB installed in the directory?
C:\Program Files\MATLAB\R2009a\bin
I did that, however, it didn't work out. I will be grateful if you help me clearly. I just read README file, but it's not clear to understand and there is no other instructions online on the internet.
For the time being, it does not matter where you put that folder. You'll have to compile the Matlab-MEX files, from the source code that resides in the matlab subfolder of your extracted libsvm package.
Below, I will call the libsvm-3.14 (for example: C:\libsvm-3.14) extracted folder ROOT (so replace ROOT wilth C:\libsvm-3.14 below).
So, fire up Matlab and, then, at its command prompt, type:
cd ROOT
cd matlab
make
Now, in the ROOT/matlab folder, you should have obtained two MEX files (with the .mexw32 or .mexw64 extension). These are the files that you will use from now on. You can discard the rest, except those files (and, maybe, some other generated libraries).
According to the Makefile (that is ROOT/matlab/make.m), the MEX files are called svmtrain and svmpredic (+ the extension).
So, next step would be to create a subfolder called libsvm/ under your's Matlab/toolbox folder, copy the two MEX files therein and, then, add that libsvm/ folder to the Matlab Path (not the Path of your system, but of your Matlab installation).
Then, by typing:
svmtrain
and
svmpredict
you should have the help (usage) of these two functions.
With the aid of #axeoth, here is the solution. I followed instruction files in matlab subfolder of extracted libsvm package. I downloaded and installed Microsoft Visual Studio 2010 and wrote 'mex -setup' on command window of MATLAB to choose a suitable compiler for mex (I use MATLAB R2012b in 32-bit PC, so I found supported compilers in this link http://www.mathworks.com/support/compilers/R2012b/win64.html) After then, I followed #axeoth's instructions. I changed the name of the folder to ROOT and moved it to Documents/MATLAB. I started MATLAB and on command window, I wrote these below "one by one"
>> cd C:\Users\HUstat\Documents\MATLAB\ROOT\matlab
>> cd matlab
>> make
then I copied everything obtained in ROOT/matlab subfolder. I created a new folder named libsvm under MATLAB/toolbox folder and pasted everything there. and then, I added that libsvm/ folder to the Matlab Path by using "Set Path" button on MATLAB R2012b. After then I wrote "svmtrain" and "svmpredict" so I got the helps of these two commands.
For those having major compiler problems I thought I'd leave some extra information on the subject of installing compilers. This was a frustrating problem I had an ended up contacted MATLAB for help. I would have commented in the above posts but I do not have enough "rep" so here it is:
I was unable to install Microsoft Windows SDK 7.1, whether via Microsoft Visual Studio 2010 or otherwise. I found out that this was because I had a certain version of Microsoft Visual installed (version 10.0.04... was the cause of the problem for me). The work around was to uninstall Visual, install SDK 7.1 independently and then re-install Visual after. The process is written up in greater detail in the link below:
http://www.mathworks.com/matlabcentral/answers/95039-why-does-the-sdk-7-1-installation-fail-with-an-installation-failed-message-on-my-windows-system
It may also be that you have the compiler installed but that it wasn't recognised until MATLAB "found" it. This happened to me after the re-install. To check if you have the correct compiler and "find" it run mex.getCompilerConfigurations('Any','Installed') to get a full list. Then do mex -setup using the SDK 7.1 choosing the C/C++ version over FORTRAN.
I know the question is answered already but hopefully this may help someone the same predicament I had.

Tutorial/Guide to create a classic, small Linux application in a package (Debian)

I've made a small script in my machine, and an alias in .bashrc that calls it. It's a bash script with 3 lines, but it can grow.
Now, some people in my team found it useful, and want to use it.
Instead of saying "copy this alias, do this, do that, install that lib" I was thinking about creating a simple package to be a little more professional. Fact is, I've never done something like this before. And the problem to me is not creating a package, is trying to decide what usually do you put in a package.
Suppose I want to take my script, and create myapplication. I want to create a .deb file that my team would install and:
Have a /usr/bin/myapplication or /usr/sbin/myapplication (what's the difference between them?), so they would just call myapplication at their terminal and it would work;
Have a man page; (Where are usually located man pages in a debian system?);
Have a possibility to read a .myapplicationrc in home folder with some configurations;
Have an entry for shortcuts in a gnome installation (is it possible to have an universal shortcut "format" that's is available to KDE and Gnome as well?);
Install dependencies.
I'm new to all that stuff. I usually code simple scripts and create an alias in my bashrc. I've never done a package before. Which guides do you know of that can help me accomplish what I thinking of above?
Here is a place to start, though I welcome a more succinct answer.
I couldn't find a complete guide. I think the best thing to do is download a package that does exactly what I'm thinking of and do some reading, like taskwarrior.

Creating a self-extracting zip archive on a linux box

Due to a number of constraints that I won't get into, I have to create a self-extracting ZIP archive on a linux box. The resulting archive should be executable on Windows only. Is this at all possible? If so, what tools would do the job?
Background: when the user downloads a setup package from my linux box, I need that setup package to be pre-populated with a certain key. I only know that key at runtime; my idea was to write a simple .xml file with that key, then zip up the .msi installer with that xml file into a self-extracting archive, and send that file to the browser. If you have alternative ideas on how to make it happen, I'd love to hear those, too
Your answer can be found at the following page: http://ubuntuforums.org/showthread.php?t=847329 Please note that I do not take credit for anything other than using Google and finding something that sounds logically like it would work. I do not guarantee that this information will work, or that you will be able to find the mentioned materials online anymore. I'm just a fan of Google. I hope this helps.
The problem A few days back I had to
create a Win32 compatible
self-extracting ZIP file for a friend.
Sounds easy, right. The problem was
that I didn't have a Windows machine
nearby and I didn't want to install
any archiving programs under Wine.
NOTE: A freeware ZIP program such as
IZArc under Wine can be used to create
a Win32 self-extracting ZIP file too.
That will not be covered by this
howto, sorry.
The "research" Googling around I found
this forum post dated August 2003.
Reading it I found out that
self-extracting ZIP files are nothing
more but a suitable unzip binary
followed by a normal ZIP file. I used
the unzipsfx.exe included in Info-ZIP
UnZip 5.52.
The link on that post worked a few
days ago so I got my hands on the
unzipsfx.exe that I was looking for.
Today, 2nd July 2008 I found the link
dead. After some googling I didn't
find a working link anywhere. I read
the licence a few times and understood
that I can redistribute the original
unzipsfx.exe with a license included.
Please note that the
unzipsfx-552_win32.tar.gz (80 kB) is
not an official Info-ZIP package and
it includes copyrighted software that
I take no credit for. More info in the
Info-ZIP license that is also included
in the tarball. The source code for
the binaries included can be found
here.
The solution
Step one, getting the unzipsfx.exe and
zip package:
* open the Terminal (in Ubuntu press alt+f2 and type gnome-terminal)
* type in the following commands Code:
wget
http://kolmoskone.homelinux.org/~kaja/kamaa/unzipsfx-552_win32.tar.gz
tar zxf unzipsfx-552_win32.tar.gz sudo
apt-get install zip
Step two, creating a ZIP file in
Ubuntu:
* open the file manager (nautilus) and select the files you want to have
zipped
* right click and select Create an archive (or similar). Select a
location for the ZIP file, using your
home directory is the easiest. Select
type .zip. See man zip for information
on how to create a ZIP file in command
line.
Step three, making the ZIP file
self-extracting
* type in the following commands Code:
cat unzipsfx-552_win32/unzipsfx.exe
MYZIPFILE.zip > mysfxfile.exe zip -A
mysfxfile.exe
mysfxfile.exe can now be opened in any
Win32 compatible system (including for
example Windows XP/2000/Vista and even
Wine in Linux) or ANY ZIP COMPATIBLE
archive program such as file-roller in
Ubuntu.
I was able to make this work with unzipsfx. There's a newer version of it available - just came out in April 2009 - version 6.0. Version 5.52 didn't support the critical functionality that I needed - launching a particular setup file after the extraction is completed.
So I downloaded the source files for 6.0. I then modified them to exclude the "prompt to launch stuff" check that is there by default. I recompiled using Visual Studio 2008, tried the steps described in the tutorial above, and it all works like a charm now.

Resources