Class-Dump Installation - objective-c

So this may sound like a really stupid question and I HAVE looked at the how-to from the parent website, but no matter what I do, I cannot get this program to even start to install...
I tried entering:
cd /opt/local/bin/portslocation/dports/class-dump
which returned a "this file/director doesnt exist" error, so i tried to get to it folder by folder. when i got all the way to:
cd /opt/local/bin/
i cannot go any further. when i check the contents of the bin directory, the only files i can find are (and i cannot access these apparently either):
"daemondo port portf portindex portmirror"
i have tried doing this on 2 computers so far to no avail, macports is installed on both like the website said and i am having trouble finding any support for it. please and thank you!!

Unless you're trying to develop it, why screw around? Use homebrew. As of today, and modulo a sudo here or there, you can install homebrew with
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
If this doesn't work for you, check the command line at the top of the page on homebrew.†
After this, install class-dump with
brew install class-dump
Done.
† Ping me in the comments with "command line update needed", and I'll try to keep this in sync. :)

I had issues with this for hours, but it is actually quite simple.
I downloaded the class-dump 3.3 version from CodeTheCode, Unzipped the file and copied the class-dump file to a directory. In my case the directory was /opt/theos/bin.
In terminal, I then CD to that directory using cd /opt/theos/bin
To run the class dump command line utility it is as simple as this;
./class-dump
Obviously you then need to give it it's arguments, so in my case I was using it do dump the iOS headers from the frameworks, so I used;
./class-dump -H /Developer/Library/iPhoneSimulator4.3.sdk/Frameworks/UIKit.framework/UIKit -o ~/Desktop/UIKit
Obviously I am not sure what you are using it for, but in the example above I am telling class-dump to dump header files from the directory given, and output them to /Desktop/UIKit.
The theory is carried throughout.

Have you tried getting the binary from http://www.codethecode.com/projects/class-dump/?

Related

Singularity Recipe: How to access executable within container?

I am a beginner with Singularity.
What I want to achieve in the long run: I have a programming project with a long lists of dependencies, and I want to be able to give the program to other people in my company without there being bugs caused by missing dependencies, or wrong versions of dependencies.
The idea was now to use Singularity in order to easily provide a working environment.
In order to test this, I wrote a Hello World application which I now want to run in a container. I have a folder HelloWorld/ which contains the source code for a C++ Qt project. Then I wrote the following recipe file:
project.recipe
Bootstrap: docker
From: ubuntu:18.04
%setup
cp -R <some_folder>/HelloWorld ${SINGULARITY_ROOTFS}/HelloWorld
%post
apt update
apt-get install -y qt5-default
apt install -y g++
apt-get install -y build-essential
cd HelloWorld
qmake
make
echo "after build:"
ls
%runscript
echo "before execution:"
ls HelloWorld/
./HelloWorld/HelloWorld
where the echos and directory listings are for my current debugging process.
I can sucessfully build an image file using sudo singularity build --writable project.img project.recipe. (My debugging output shows me that the executable was build successfully.)
The problem is now that if I try to run it using ./project.img, or singularity run project.img, it won't find the executable.
Using my debugging output, I found out that the lines in %runscript use the folders outside of the container.
Tutorials like https://sylabs.io/guides/3.1/user-guide/build_a_container.html made it seem to me as if my recipe was the way to go, but apparently it isn't?
My questions:
Is there some way for me to access my executable? Am I calling it wrong?
Is the way I do it the way it is supposed to be done? Or would one normally do something like getting the executable outside of the container and then use the container to call that outside file? Or is there a different best practice?
If the executable is to be copied outside of the container after compilation, how do I do that? How do I access outside folders when I'm within %post?
Is this the best work process for what I want to achieve? Later on, my idea is that the big project is copied likewise in the container, dependencies are either installed or copied, then the project is compiled and finally its source being deleted. I also considered using a repository, but I can't have the project being in an open repository, and I don't want to store any passwords.
Firstly, use %files, don't use %setup. %setup is run as root and can directly modify the host server. You can very easily and accidentally break things without realizing it. You can get the same effect this way:
%files
some_folder/HelloWorld /HelloWorld
You are calling it wrong. In your %setup (and hopefully now in your %files) steps, you are copying the data to /HelloWorld. In your %runscript your are calling ./HelloWorld/HelloWorld which is the equivalent of $PWD/HelloWorld/HelloWorld. Since singularity automatically mounts in $PWD (as well as $HOME and some other directories), you are not calling what you're trying to call.
You don't copy the executable outside of the container, you just need to make sure what you're executing is where you think it is.
There is no access to the host filesystem in %post, you should have everything you need copied in via %files first.
That's a reasonable workflow. Having a local private repo for the code is probably a good idea for tracking your changes, but that's your call.

NPM on LEMP cannot find module, wrong path

Total Linux noob here. I am trying to configure a Pleroma development environment on DO droplet. Installed LEMP, installed SSL, installed PostgreSQL, installed Pleroma, so far so good.
Then I installed Node, NPM, cloned Pleroma-FE (apparently it installs in /user/pleroma-fe folder). I am following the very brief build instructions here:
https://git.pleroma.social/pleroma/pleroma-fe
When I get to the command in those build instructions: npm run build
I am getting error: Error: Cannot find module '/user/build/build.js'
It's because actual path to the build file is /user/pleroma-fe/build/build.js
Apologies if this is a duplicate. I see other questions about this.
Fixing npm path in Windows 8 and 10
and the reply seems to set the PATH. This answer might apply to my situation. But my question is: it is clearly already looking in a well defined path (which is different from all the other questions, which don't seem to have well defined path in the error message). But it is the wrong path. How do I make it look in the correct path?
I tried the npm command and specified the complete path, and every variation. and none worked. So it seems fixing the path won't fix this problem.
Sorry I do not currently know enough Linux to be able to fix this. I tried to tag this with Pleroma but I don't have enough reputation to create a new tag. Any help is much appreciated. Thanks in advance.
I continued to work on this with some help of a Linux admin on Fiverr and the Pleroma developers chat with success, thanks to all.
The solution did not involve changing the path. There were several different things going on. First, I needed to change directory into the development project source folder:
cd pleroma-fe
Once I did that, npm found the build module. Next issue was Node was very old and I needed to get the latest version. I used the instruction here for NodeJS (10):
https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
Next issue was npm was missing some modules. This was fixed with:
npm install
After that the build completed with no errors.
npm run build
After a successful build, you will see a list of files that have changed as a result of the build.
Next issue is that simple changes in HTML text were not live, ie. not reflected in the refreshed web page. This is fixed by copying all the resulting build files to the production folder using rsync. In my case the command was:
rsync -av /user/pleroma-fe/dist/ /home/pleroma/pleroma/priv/static/
Pleroma is a neat Twitter-like user interface to ActivityPub fediverse, it includes a Mastodon UI as well, and thanks to the developers for making it free and open source.

redis-cli not working on linux

I have installed redis onn linux.
redis sever started correctly however when I try to start redis-cli I get this error
bash: redis-cli: command not found
file redis-cli output is
ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, BuildID[sha1]=0x5fe1c6d3da13df88f2ea826ac762f088c29b81d5, not stripped
I don't know what's the reason
but when I run the using this command
/usr/local/bin/redis-cli it works
but when I run redis-cli from the /usr/local/bin/ folder I get the error
bash: redis-cli: command not found
Looks like some path issue
If you built from source and you're in the default redis-stable directory that contains the source, you should be able to start the cli by running:
./src/redis-cli
It seems like redis-cli is present, reading your answer. Check this with which redis-cli.
I've installed redis on several linux machines, normally it goes very smooth. I guess you've run into a special case.
Here's my thoughts:
It might be a dynamic linking issue.
So check the headers with dump -H -X64 redis-cli.
In the headers, you can see which shared objects it is trying to find. There might be a shared object from another package in the way, for example a 32-bit only one. Ugly, and wrong, but it happens.
Use the ldd runtime dependency checker to see what those headers actually result in on your system. Install it when not present. Then simply run ldd redis-cli.
Now you've figured out what's wrong, you can do several things.
1) Remove the conflicting package, if possible.
2) Use the LIBENV environment variable, to set the search path for shared objects, prior to starting the process
3) Use the -blibpath linker option at compile/link time to alter the header, giving it a different search path. The -bnolibpath could also help you.
4) Patch the header afterwards. There are tools for this. This is generally not the preferred way to go.
Hope this helps, TW
Edit:
Although make, make test, and make install were always fine, the server install script install_server.sh was always a bit buggy. This has just been fixed in 2.8.8. I recommend using the latest version.
Edit 2:
The OP's problem turned out to have nothing to do with dynamic linking, it was a simple PATH issue. I leave the answer as is, for historical purposes.
This maybe happening because the executable isn't in path. In order to solve this, you can try copying redis-cli on the /usr/local/bin/ folder with this command:
sudo cp /src/redis-cli /usr/local/bin/

openssl/bn.h: No such file or directory

I am totally new to Obj-C, and trying to compile Big Number related Objective C files
The function was easy, just to initialize a big number and use NSLog to print it out.
I used
#import <openssl/bn.h>
but the xcode always displays me an error:
openssl/bn.h: No such file or directory.
I tried to find out if the .h file were missing, and typed locate in my terminal:
$ locate bn.h
/Developer/SDKs/MacOSX10.6.sdk/usr/include/openssl/bn.h
/usr/include/openssl/bn.h
/usr/local/texlive/2010/texmf-dist/tex/generic/hyph-utf8/patterns/txt/hyph-bn.hyp.txt
It seemed I have the bn.h file, but why the xcode kept me from compiling?
Thanks for any help!!
I had this exact problem, tried libcurl4-openssl-dev which didn't work, but found elsewhere that the following is the exact and proper solution:
sudo apt-get install libssl-dev
I'm working on a Raspberry Pi 3 running Jessie trying to compile hostapd, but I'm pretty sure the solution is generic across a wide range of distributions and projects, particularly if you swap apt-get for yum or other package manager.
To use openssl/bn.h on Linux:
$ sudo apt-get install libcurl4-openssl-dev
I would say that the OpenSSL headers are part of the Mac OS X environment, not part of the iOS environment. I you want OpenSSL for iOS, you need to compile it yourself. You'll find some help there (or alternatively there).

CopSSH + Git: path issue

I'm confused.
I've installed copSSH and linked it with msysgit installation (by adding path to it).
And now whenever I use copSSH tools (like ls, cd) I should use the absolute paths in form like '/home', /cygdrive/d/copSSH/home.
But when I used git I should use absolute paths in a different (another) form.
like '/copSSH/home', 'd:/copSSH/home'.
For me it's really strange.
Have anybody clue for that and an idea how to fix it?
Thanks a lot Andrei.
P.S. I use WinXP, git version 1.7.0.2.msysgit.0, copSSH 3.1.0.
Everything is installed using
http://www.timdavis.com.au/git/setting-up-a-msysgit-server-with-copssh-on-windows/
article (with some modifications).
Unfortunately, cygwin and mingw have a different way of mapping windows drives and directories, so before you enter a path for anything, you need to know whether it is a cygwin or mingw binary.
What I can suggest is to remove CopSSH bin directories from your PATH (at least from git bash path), so that all shell commands available use the mingw format. The only place where you would have cygwin paths would be when you do and ssh actions this way. For example, when you clone from d:\repositories\myrepo.git, you could use git clone ssh://user#srv/cygdrive/d/repositories/myrepo.git (cygwin form). To work with git in, say d:\clones\myrepo, you can use ls /d/clones/myrepo (mingw32 form).
Also, before you attempt any git clones, you can use putty or plink to make an ssh connection, and look around. If inside the ssh connection, you can do ls /home/myrepo.git, then git clone ssh://user#srv/home/myrepo.git should work.
Please try this format
git clone gituser#sshserver:myapp.git