How to add a new file in a folder using quilt patch technique? - openwrt

I want to add a new file inside asterisk-chan-dongle-13 in LEDE(openwrt). For that how can I write a patch file(quilt) to add a new file inside a folder like asterisk-chan-dongle-13?

You can unarchive your source code, then move into the source directory and run:
quilt new 001-name_of_your.patch
This will create new patch in your environment (it will create a directory named patches in which quilt will store all the patches). After that you must add your new file to the patch running:
quilt add my_file.patch
At this point you can edit the file. You can check the modifications to the file using:
quilt diff
When you're finished you can update the patch file with:
quilt refresh
You will find your updated patch in the patches directory.

Related

Create new directory to forcefully replace the old one in ruby on rails

I am trying to create the directory in ruby on rails.
I have succeeded to create the directory using FileUtils.mkdir(), but I need to create the directory so that the newly created directory replace the old one.
I have searched a lot on google and also study the docs of FileUtils but could not find to achieve this.
Is there any way to get it done?
Unfortunately in FileUtils not such thing as recreate directory. But you delete and create dir:
FileUtils.rmdir('your_dir')
FileUtils.mkdir('your_dir')
You may all available functions to handle directories in FileUtils module and Dir class.
Why not delete the directory and then create it again:
require 'fileutils'
FileUtils.rm_rf('directorypath/name')
or
FileUtils.remove_dir(somedir)

Make link/alias to another directory in public folder ruby on rails

I am trying to create a link on public/virt folder to a directory ../../../../testdir with name pipelines
for that I have created virt directory using mkdir but I am not able to create this alias/link.
how can it be done using command in putty?
First, make sure you have permission to write to the directory you want the symlink to be located in.
Also, make sure that the relative path you want to link to exists. If it does not, the link will still be created but you may end up somewhere you didn't intend to jump to.
Also, since virt is the name of the symlink you want to create, you did not need to make it with mkdir. "virt" will be the name of the symlink file created by ln
To make a symbolic link named /public/virt that points to the testdir directory four levels up from the current working directory:
ln -s ../../../../testdir public/virt

accidentally removed log folder in rails .gitignore, log folder not being generated on pull request

I'm new to git and rails. I checked out a rails project and had a bunch of log files come in with it. I wanted to remove the log files and add an entry into .gitignore to ignore contents of the log directory. I think I screwed up because when my colleague tried to checkout from master, his log directory didn't even get generated. I think instead of ignoring contents of the log file, I ignored the entire log directory. What's the best way to change this .gitignore file to only ignore log files NOT the log directory itself? Also I don't think I need all these things in the .gitignore. What's a nice clean and simple .gitignore for a rails project?
*.sublime-*
.bundle
db/*.sqlite3*
log/*.log
*.log
tmp/**/*
tmp/*
Gemfile.lock
doc/api
doc/app
*.swp
*~
.DS_Store
Thank you in advance.
Git ignores empty folders, in fact it doesn't really know they exist (it knows about trees pointing toward file contents). Since there is no file content to point to, there is no tree and hence git will not create a folder.
Common way around this is to add empty file within the folder. Convention is to name this file .keep. Add such file to the empty folder, add it to the index, commit and push and folder will be created on checkout.

How to Create a Patch file on Mac OS X

In my iOS Application I want to create a patch file for the modified files to send it to Review Board.How can i generate a patch file in Mac OS by using Terminal
If you don't want to use VCS for creating patch then you can use diff tool.
You can create patch for one file using
diff -u original.c new.c > original.patch
Or
diff -rupN original/ new/ > original.patch
For entire folder
First check in the Xcode Downloads whether the Command Line Tools are downloaded or not. if not first download that and then follow the below procedure
In Terminal go to the directory where we need that Patch File and execute the Command svn diff > somename.patch then you will get a patch file in that directory

hibernate.cfg.xml path

I have a java project and I am using hibernate.The thing here is I want to place the hibernate.cfg.xml file outside "src" folder, but when I am configuring this file it is showing FileNotFoundException. If I put it inside src folder its ok. But I want to separate the java src and all config file in separate folder.
root
|____src
|____conf
|____mapping
|____(all xml file with hibernate.cfg.xml)
SessionFactory _sessionFactory = (new Configuration()).configure("./conf/mapping/hibernate.cfg.xml").buildSessionFactory();
Its showing exception......
Add conf/mapping directory to your CLASSPATH and load the configuration file
new Configuration().configure("/hibernate.cfg.xml").buildSessionFactory();
or just
new Configuration().buildSessionFactory();
as this is the standard name.
Regardless there would be no ./ at the beginning of the resource path.
What you want to do is
include conf/mapping in your project build path(With Eclipse properties->javabuild path->source->add Folder)
then no need to precise the hibernate config file in your code
new Configuration().buildSessionFactory(); is enough
This manipulation is simple and works like a charm.

Resources