recipe

Importing Mysql database using Ruby/Chef Recipe for Vagrant

▼魔方 西西 提交于 2019-12-02 21:12:43
I am writing a chef script to automate setting dev environments. I can get a database created and grant privileges but I am trying to find out a way to import a mysql dump file into the database that has just been created. My code for granting the access is ruby_block "Execute grants" do block do require 'rubygems' Gem.clear_paths require 'mysql' m = Mysql.new('localhost', "root", node[:mysql][:server_root_password]) m.query("GRANT ALL ON *.* TO 'root'@'10.0.0.1' IDENTIFIED BY '#{node[:mysql][:server_root_password]}'") m.query('FLUSH PRIVILEGES') end end and I was hoping I would be able to do

bitbake recipe - doing a simple copy of the image

笑着哭i 提交于 2019-12-02 02:10:33
I am attempting to write a recipe that would simple copy two files (MyfileA , MyfileB) to a specific directory when the overall image is built. This is what my directory structure looks like: MyDir/MyRecipe.bb MyDir/files/MyfileA MyDir/files/MyfileB I would like the two files to be copied to a folder in home (which would not exist initially hence the directories should be created)The folder lets say is called "Testfolder" This is what my bitbake file looks like DESCRIPTION = "Testing Bitbake file" PR = "r0" SRC_URI = "file://MyfileA \ file://MyfileB " do_install() { install -d MyfileA ~

How to install recursively my directories and files in BitBake recipe

强颜欢笑 提交于 2019-12-01 18:08:47
I would like to install/copy all my directories and files recursively from working directory to my target package rootfs on yocto build system. I tried the solution provided by Tobias Bystricky in How to install directory structure recursively in OpenEmbedded BitBake recipe? but I faced "No such file or directory" error I did , install -d ${D}${sysconfdir}/xxx/ install -d ${D}${sysconfdir}/xxx/yyy install -d ${D}${sysconfdir}/xxx/yyy/zzz install -d ${D}${sysconfdir}/xxx/yyy/zzz/kkk find ${WORKDIR}/xxx/yyy/zzz/kkk/ -type f -exec 'install -m 0755 "{}" ${D}${sysconfdir}/xxx/yyy/zzz/kkk/' \; Error

How to install recursively my directories and files in BitBake recipe

无人久伴 提交于 2019-11-28 07:59:57
问题 I would like to install/copy all my directories and files recursively from working directory to my target package rootfs on yocto build system. I tried the solution provided by Tobias Bystricky in How to install directory structure recursively in OpenEmbedded BitBake recipe? but I faced "No such file or directory" error I did , install -d ${D}${sysconfdir}/xxx/ install -d ${D}${sysconfdir}/xxx/yyy install -d ${D}${sysconfdir}/xxx/yyy/zzz install -d ${D}${sysconfdir}/xxx/yyy/zzz/kkk find $

为什么黑客都用linux讲解二

混江龙づ霸主 提交于 2019-11-27 06:49:13
http://www.xiachufang.com/recipe/104007535 http://www.xiachufang.com/recipe/104007536 http://www.xiachufang.com/recipe/104007537 http://www.xiachufang.com/recipe/104007538 http://www.xiachufang.com/recipe/104007539 http://www.xiachufang.com/recipe/104007540 http://www.xiachufang.com/recipe/104007541 http://www.xiachufang.com/recipe/104007542 http://www.xiachufang.com/recipe/104007543 http://www.xiachufang.com/recipe/104007544 http://www.xiachufang.com/recipe/104007545 http://www.xiachufang.com/recipe/104007546 http://www.xiachufang.com/recipe/104007547 http://www.xiachufang.com/recipe

为什么黑客都用linux

不羁岁月 提交于 2019-11-27 06:44:37
http://www.xiachufang.com/recipe/104004166 http://www.xiachufang.com/recipe/104004167 http://www.xiachufang.com/recipe/104004168 http://www.xiachufang.com/recipe/104004169 http://www.xiachufang.com/recipe/104004170 http://www.xiachufang.com/recipe/104004171 http://www.xiachufang.com/recipe/104004172 http://www.xiachufang.com/recipe/104004173 http://www.xiachufang.com/recipe/104004174 http://www.xiachufang.com/recipe/104004175 http://www.xiachufang.com/recipe/104004176 http://www.xiachufang.com/recipe/104004177 http://www.xiachufang.com/recipe/104004178 http://www.xiachufang.com/recipe

Using while in list comprehension or generator expressions

旧巷老猫 提交于 2019-11-27 04:37:34
I can use if and for in list comprehensions/generator expressions as list(i for i in range(100) if i*i < 30) I know this is not the most efficient but bear with me as the condition could be much more complicated and this is just an example. However, this still goes through hundred iterations and only yields a value in the first 6. Is there a way to tell the generator expression where to stop with something like this: list(i for i in range(100) while i*i < 30) However, while is not understood in generator expressions. So, my question is, how do I write a generator expression with a stopping

How can I use my sql knowledge with Cloudant/CouchDB?

巧了我就是萌 提交于 2019-11-27 04:07:24
Some developers who have a good knowledge of querying SQL databases struggle to implement the equivalent query patterns in Cloudant/CouchDB. How can these developers translate their SQL knowledge to Cloudant/CouchDB? Chris Snow This community wiki page provides links to some SQL patterns showing how they may be implemented in Cloudant. As this is a community wiki feel free to add new Q&A links here. General database queries Joining two documents by key? How do I do the SQL equivalent of “DISTINCT” in CouchDB? How do I do a triple join in CouchDB? Inner joining by document field? How do I do

Using while in list comprehension or generator expressions

只谈情不闲聊 提交于 2019-11-26 11:17:03
问题 I can use if and for in list comprehensions/generator expressions as list(i for i in range(100) if i*i < 30) I know this is not the most efficient but bear with me as the condition could be much more complicated and this is just an example. However, this still goes through hundred iterations and only yields a value in the first 6. Is there a way to tell the generator expression where to stop with something like this: list(i for i in range(100) while i*i < 30) However, while is not understood

How can I use my sql knowledge with Cloudant/CouchDB?

我们两清 提交于 2019-11-26 11:03:24
问题 Some developers who have a good knowledge of querying SQL databases struggle to implement the equivalent query patterns in Cloudant/CouchDB. How can these developers translate their SQL knowledge to Cloudant/CouchDB? 回答1: This community wiki page provides links to some SQL patterns showing how they may be implemented in Cloudant. As this is a community wiki feel free to add new Q&A links here. General database queries Joining two documents by key? How do I do the SQL equivalent of “DISTINCT”