can sombody assis with installing symfony please? - symfony1

yikes i have forgotten but am following:
http://www.symfony-project.org/getting-started/1_4/en/03-Symfony-Installation
i have a jobeet directory and want to install symfony-1.4.16 here.
i downloaded symfony-1.4.16.tgz and unpacked it with tar zxpf symfony-1.4.16.tgz
then moved it mv symfony-1.4.16 symfony
and removed the tgz with rm symfony-1.4.16.tgz
i have this now:
helloises#helloise:~/jobeet$ ls -lah
total 7.2M
drwxr-xr-x 3 helloises helloises 4.0K 2012-01-09 15:06 .
drwxr-xr-x 83 helloises helloises 4.0K 2012-01-09 14:59 ..
-rw-r--r-- 1 helloises helloises 593K 1970-01-01 11:13 package.xml
-rwxr-xr-x 1 helloises helloises 3.6M 2012-01-04 09:13 symfony-1.2.12.tgz (is in GREEN)
drwxr-xr-x 5 helloises helloises 4.0K 2012-01-09 15:06 symfony (is in BLUE)
-rw-r--r-- 1 helloises helloises 3.1M 2012-01-09 15:05 symfony-1.4.16.tgz (is in RED)
huh? dont know what is going on here.. i unpacked version 1.4.16
i run:
helloises#helloise:~/jobeet$ ./symfony generate:project jobeet --orm=Propel
bash: ./symfony: is a directory
any help please?
thanks

You need to make a lib/vendor folder. The symfony folder must be under the vendor folder (*/wherever_my_project_is/lib/vendor/symfony*).
The go up two levels (so you can see the lib folder (if you do a ls) and run
php lib/vendor/symfony/data/bin/symfony -V
If everything is ok, that should return the symfony version.
Then you can generate a new project:
php lib/vendor/symfony/data/bin/symfony generate:project PROJECT_NAME
That will create the necessary directory structure and also make the symfony executabile for you (in your project directory). See more here. I recommend reading A Gentle Introduction to symfony tutorial.

Related

How do I run objcgen directly to do .NET Embedding on MacOS

I followed the instructions at Installing .NET Embedding and...
I installed Visual Studio 2019 on my Mac 10.14.6
I created a Xamarin.ios class lib project
I installed Nuget Embeddinator-4000
I added a hello world function: void main(){ Console.WriteLine("hello world");}...
I built without problem.
The next instruction says to.....
Running manually
Now that the NuGet is installed, you can run the tooling by hand.
Open a Terminal (macOS) or Command Prompt (Windows)
Change directory to your solution root
The tooling is installed in:
./packages/Embeddinator-4000.[VERSION]/tools/objcgen (Objective-C)
./packages/Embeddinator-4000.[VERSION]/tools/Embeddinator-4000.exe
On macOS, objcgen can be run directly.
...But there is no ./packages/ directory <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> Last login: Fri Mar 6 10:05:48 on ttys002
> DOUGs-MacBook-Pro:Embedding_2020-03-06 dbell$ ls -l total 24
> -rw-r--r-- 1 dbell staff 2193 Mar 6 09:02 Embedding_2020-03-06.csproj
> -rw-r--r-- 1 dbell staff 827 Mar 6 08:58 Embedding_2020-03-06.sln
> -rw-r--r-- 1 dbell staff 249 Mar 6 09:03 HelloWorld.cs drwxr-xr-x 3 dbell staff 96 Mar 6 08:58 Properties drwxr-xr-x 3 dbell
> staff 96 Mar 6 08:58 bin drwxr-xr-x 8 dbell staff 256 Mar 6
> 09:03 obj DOUGs-MacBook-Pro:Embedding_2020-03-06 dbell$ ls ./packages
> ls: ./packages: No such file or directory <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> DOUGs-MacBook-Pro:Embedding_2020-03-06 dbell$
Ah, hah! The objcgen tools need to first be built. I found instructions how at Github > Embeddinator-4000 > README.md > "Building".
Summary -- installation of .NET to Objective-C converter...
1. Clone github > Embeddinator-4000
git clone https://github.com/mono/Embeddinator-4000.git
2. cd into the cloned dir
3. Install other stuff:
git submodule update --recursive --init
4. Build the .NET to Objective-C converter:
cd objcgen
make
5. Build the 'wrapper' (ie. command access) to objcgen (took 10-15 minutes for me):
make nuget
6. Generate Objective-C from your .NET C# class lib
7. <somewhere in the bowels of your Mac>/Embeddinator-4000/objcgen/_build/objcgen <elsewhere in the bowels of your Mac>/hello-from-csharp/hello-from-csharp/bin/Debug/hello_from_csharp.dll --target=framework --platform=iOS --outdir=output -c --debug
NOTE: hello-from-csharp is from MICROSOFT DOC .NET EMBEDDING HELLO WORLD

Graphs don't show when Rmarkdown posted to blogdown on shiny server [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I'm new to blogdown and I want to build my site on shiny server. But problem comes.
I followed the advice from https://github.com/rstudio/blogdown/issues/161 to copy the public/ folder to my shiny server.
root#jamesVM:/srv/shiny-server# pwd
/srv/shiny-server
root#jamesVM:/srv/shiny-server# ll
total 12
drwxr-xr-x 3 root root 4096 4ÔÂ 29 22:57 ./
drwxr-xr-x 3 root root 4096 4ÔÂ 28 00:33 ../
lrwxrwxrwx 1 root root 38 4ÔÂ 28 15:11 bi -> /home/runrunwei/GitRepo/MySite/public//
lrwxrwxrwx 1 root root 38 4ÔÂ 28 00:33 index.html -> /opt/shiny-server/samples/welcome.html
drwxr-xr-x 24 root root 4096 4ÔÂ 29 22:57 public/
lrwxrwxrwx 1 root root 37 4ÔÂ 28 00:33 sample-apps -> /opt/shiny-server/samples/sample-apps/
root#jamesVM:/srv/shiny-server#
But I found a problem that graphs ggplot2 and plot don't show. But plotly is OK.
The folder bi/ is symbolic link and public/ was copied there from /home/runrunwei/GitRepo/MySite/public/. In both way, the graphs show the same way.
At beginning I thought there is something wrong with path. So I set relative urls
true in config.toml as following:
baseurl = "/"
languageCode = "en-us"
title = "A Hugo website"
theme = "hugo-lithium"
googleAnalytics = ""
disqusShortname = ""
ignoreFiles = ["\\.Rmd$", "\\.Rmarkdown$", "_files$", "_cache$"]
relativeurls = true
My hugo version:
> blogdown::hugo_version()
[1] ‘0.30.2’
relativeurls = true didn't help me. Then I opened the index.html (in /srv/shiny-server/public/2018/04/27/testrmarkdown/) file which is rendered by blogdown::build_site, with browser from rstudio server's file explorer and found the graphs are there. I compared both paths of the graphs through Inspect of chrome, they are the same.
I don't know how to fix it now.

Rails 4: how I use the contents of a markdown file in a view?

I have a Rails 4 app, and I would like to have a "changes" page that displays the changes introduced in recent versions. I already have this information in a file CHANGELOG.md in the root of my project directory. It would be very convenient if I could have a changes.html.erb view that converts CHANGELOG.md to HTML.
-rw-r--r-- 1 ubuntu ubuntu 3640 Apr 24 22:50 CHANGELOG.md
-rw-r--r-- 1 ubuntu ubuntu 1180 Apr 30 13:58 Gemfile
-rw-r--r-- 1 ubuntu ubuntu 6324 Apr 30 13:58 Gemfile.lock
-rw-r--r-- 1 ubuntu ubuntu 155 Mar 10 14:47 README.md
-rw-r--r-- 1 ubuntu ubuntu 249 Mar 10 14:47 Rakefile
drwxr-xr-x 8 ubuntu ubuntu 4096 Mar 10 14:47 app/
drwxr-xr-x 2 ubuntu ubuntu 4096 Mar 10 14:47 bin/
drwxr-xr-x 5 ubuntu ubuntu 4096 Apr 24 22:50 config/
-rw-r--r-- 1 ubuntu ubuntu 153 Mar 10 14:47 config.ru
drwxr-xr-x 3 ubuntu ubuntu 4096 Mar 31 02:38 db/
drwxr-xr-x 4 ubuntu ubuntu 4096 Mar 10 14:47 lib/
drwxr-xr-x 2 ubuntu ubuntu 4096 Mar 14 13:53 log/
drwxr-xr-x 2 ubuntu ubuntu 4096 Mar 14 14:01 public/
drwxr-xr-x 2 ubuntu ubuntu 4096 Apr 26 22:44 spring/
drwxr-xr-x 8 ubuntu ubuntu 4096 Mar 29 02:58 test/
drwxr-xr-x 6 ubuntu ubuntu 4096 Mar 11 23:20 tmp/
drwxr-xr-x 3 ubuntu ubuntu 4096 Mar 10 14:47 vendor/
I was able to follow this example to create a helper method to convert Markdown to HTML using Redcarpet:
application_helper.rb
require 'redcarpet'
module ApplicationHelper
# Convert markdown to HTML
def markdown(text)
options = {
filter_html: true,
hard_wrap: true,
link_attributes: { rel: 'nofollow', target: "_blank" },
space_after_headers: true,
fenced_code_blocks: true
}
extensions = {
autolink: true,
superscript: true,
disable_indented_code_blocks: true
}
renderer = Redcarpet::Render::HTML.new(options)
#markdown ||= Redcarpet::Markdown.new(renderer, extensions)
#markdown.render(text).html_safe
end
end
I then created a view and action in my static pages controller pages#changes.
changes.html.erb
<h1 class="page-header">Recent Changes</h1>
<div class="row">
<p>
<%= markdown("We should be able to render `code` and **bold words** with [Markdown](https://daringfireball.net/projects/markdown)") %>
</p>
</div>
This works, but I am not sure how I would instead pass CHANGELOG.md to the markdown method. It would be nice if I could leave CHANGELOG.md in the top level directory, but I suppose I could move it if it would allow me to access it from a view.
You can load the contents of a file using File.read(). Knowing this, you simply need the path to the file: Rails.root/CHANGELOG.md
One way of achieving your desired result would be to place the following code in your page's controller, then rendering the markdown in the view:
#changelog = File.read("#{Rails.root}/CHANGELOG.md")
Then just use #changelog with the markdown method in the view:
<%= markdown #changelog %>
You can use embedded markdown on rails 5+ with gem emd
Add this two lines to your application's Gemfile:
gem 'redcarpet'
gem 'emd'
bundle install.
Then create a view home/changelog.html.md and paste your markdown in that file.
At your route.rb, add this line:
get '/changelog', to: 'home#changelog'
That's all. Visit http://localhost:3000/changelog to see your rendered markdown
Note: you will need a controller called home. rails generate controller home
Source: http://github.com/ytbryan/emd
Just add the kramdown-rails gem to your Gemfile and then create .md files in your views directories and it works automatically. None of the above effort is needed.
You would just read the file from disk.
Rails.root gives you a Pathname object which points to the root directory of the Rails application.
We then pass the file path to IO.read which reads the file contents and closes the file handler when its done.
<div class="row">
<p>
<%= markdown(IO.read(Rails.root.join('CHANGELOG.md')) ) %>
</p>
</div>
However you may want to use low level caching so the conversion is only done when the file changes and not on every request!
module ApplicationHelper
# ...
def file_to_markdown(file)
cache_key = [file, File.mtime(file)].join('-')
Rails.cache.fetch(cache_key) do
self.markdown(IO.read(file))
end
end
end
You would then call it like so:
file_to_markdown(Rails.root.join("CHANGELOG.md"))

Unable to cd into a grepped directory

I have a volume with spaces and periods that I am unable to cd into
bash-4.3$ ll /Volumes
total 8
drwxrwxrwt# 4 root admin 136 Apr 17 11:08 .
drwxr-xr-x 33 root wheel 1190 Feb 5 19:05 ..
lrwxr-xr-x 1 root admin 1 Apr 17 09:41 Macintosh HD -> /
drwxr-xr-x 4 username wheel 204 Jan 28 02:54 OS X 10.10.2 Update Combo
but trying to cd in this way yields
bash-4.3$ cd "$(ls /Volumes |grep 'OS X')"
bash: cd: OS X 10.10.2 Update Combo: No such file or directory
The problem, as indicated by RC in their comment is that the output from that command substitution is the bare directory name OS X 10.10.2 Update Combo which then is used as cd "OS X 10.10.2 Update Combo" but there is no such directory in the current directory. You would need cd /Volumes/"$(ls /Volumes |grep 'OS X')" to do what you wanted.
That being said using ls and grep for this is not at all appropriate. A better solution is simply to use a glob.
cd /Volumes/*"OS X"*
This will fail (as would the original) if more than one directory/file matches the glob however.

While creating a project specific gemset for a new rails application, got this error: .ruby-version is not empty, moving aside to preserve

Specifically, this is what I typed into terminal and what came back:
$ mkdir myapp
$ cd myapp
$ rvm use ruby-2.1.0#myapp --ruby-version --create
ruby-2.1.0 - #gemset created /usr/local/rvm/gems/ruby-2.1.0#myapp
ruby-2.1.0 - #generating myapp wrappers.
Using /usr/local/rvm/gems/ruby-2.1.0 with gemset myapp
.ruby-version is not empty, moving aside to preserve.
.ruby-gemset is not empty, moving aside to preserve.
$ ls -la .ruby*
-rw-rw-r-- 1 danisyellis staff 6 Jan 24 14:26 .ruby-gemset
-rw-rw-r-- 1 danisyellis staff 6 Jan 24 14:26 .ruby-gemset.01.24.2014-14:26:06
-rw-rw-r-- 1 danisyellis staff 11 Jan 24 14:26 .ruby-version
-rw-rw-r-- 1 danisyellis staff 11 Jan 24 14:26 .ruby-version.01.24.2014-14:26:06
$ cat .ruby*
myapp
myapp
ruby-2.1.0
ruby-2.1.0
I've searched the internet for that error message and haven't found anything that explains it so I don't know what it means.
It almost looks like my computer ran the command twice and tried to create a duplicate?
Questions:
Is that what happened or was it something else?
If yes, why did it do that?
What does "moving aside to preserve" mean?
Is there anything I can change/clean up so that everything works properly and cleanly
Thanks so much for any help you can give! I'm pretty new to all this so answers with a decent amount of detail/hand-holding would be appreciated.
this looks like a bug, please report it here: https://github.com/wayneeseguin/rvm/issues
in the mean time ignore this bug, you can remove the duplicate files quite easily:
rm -f .ruby-*\.*

Resources