Changing publisher name and URL - drupal

So, yeah, the form is saying:
Please contact the system administrator to change your publisher name
and I'm the system administrator for the project and I don't know what the hell am I doing. :)
I can change the name of the publisher but not the URL. I guess this also changes some URL in the dataset? Do I need to do the change with API or there is some GUI?
BTW. I'm using DGU package.

You should ssh to your server and run commands like this to change the name, and optionally the title too with the -t:
source /home/co/ckan/bin/activate && cd /vagrant/src/ckanext-dgu
python ../ckanext-dgu/ckanext/dgu/bin/publisher_rename.py $CKAN_INI highways-agency highways-england -t 'Highways England'
From: http://guidance.data.gov.uk/publisher_editing.html#rename-a-publisher
The problem is it can take a few minutes to rename and reindex all the datasets, so this often can't be done during a web request. Ideally someone would code this as a background task so this can still be done in the form. However in the meantime DGU implemented this command-line script to do it, hence the need for a sysadmin.

Related

What do I need to be able to put something in the executable svn section?

In the course I am taking, Github is being linked with R. But in the executable svn section I cannot put anything. And I don't know if I have to download something or what I'm supposed to do. In the course they do not explain anything about that point, which makes me think that it is something obvious or simple, but I have no idea about it.
Sorry for the inconvenience.
If this is about linking GitHub and RStudio, then you don't need to set anything in the SVN field.
Having specified the Git executable is enough.
Make sure your public SSH key is registered to your GitHub account.
The OP reports:
A friend told me to right click on the r icon and run as an administrator
That means the SSH keys might have been accessible only from admin account, as opposed to regular user account.

How to push small local changes to remote server with Git and Wordpress?

I'm new into Git and I'm working with Wordpress themes.
I was always using FTP client to push every small change into my remote server... I mean sometimes it was just one line of code to check the change of CSS. It was easy and nice but there will be always problem with reverting changes and since I'm learning Git, I want to change it.
I've found two ways to do it:
git-ftp
i've tried to connect my local respository with GitHub and my intention was to automatic pull changes into my remote server from GitHub (it's not working yet, i need to configure it better)
BUT, do I have to commit every single small change? Because I cant just save file and check changes with Browsersync on second monitor, I will have to commit so many times. Also which way will be better for me - maybe there are another, better ways?
I really want to improve my performance, but it looks like that's not easy or I'm doing something wrong? I know about existence things like WP-CLI, webpack, gulp but often I'm creating small websites and probably I will spend more time on configurating those things than create theme. Also I thought about working on localhost, but I really think that I'm complicating things and my job.
Really sorry if it's wrong section, but I'm new on stackoverflow - hey! I will be really thankful if you can help me, because I think that i need knowledge of someone experienced.
I'm not sur to be helpful but I'll try :
First, even for a small project, I always prefer to install a local environment for testing. It avoid risks on your remote server !
You can take a look here : https://make.wordpress.org/core/handbook/tutorials/installing-a-local-server/
Then, if you have an SSH access to your server, may be you can try to configure it to push directly from your local environment to your remote server. Here is a simple tutorial : https://gist.github.com/noelboss/3fe13927025b89757f8fb12e9066f2fa
It depends on what remote system or vps you are using.
It could be from GCP, AWS, DIGITAL OCEAN, or WP itself.
It looks like that you are using the wordpress hosting your website.
If so, you might use wp cli to login the server.
①As for the frequent testing and updating, it is a good idea to copy the remote project to your localhost. Run your web app using wampserver. And create a new repository in the github and connect it with your local folder.
Then you could use git to version control your codes, do pull and push, stash or whatever.
And after testing, you could upload the specific files or folder to the remote server via ftp or sftp periodically.
②Another way is to install the git bash or git software in your server side.
It depends on the OS you are using. If it is a win or linux.
$ add-apt-repository ppa:git-core/ppa
$ apt update; apt install git
and create new user, add it into the sudo group
create a repository in your server side and link it to the github remote repository.
I am not sure whether the second way would work.
I recommend you try the first method.
Hope this could help. Happy coding.

How to execute an exe or a file in local machine using a website or html (like clone in windows in github)

These are my requirements
How to open an pdf file which is located in my local machine using html page?
How to execute an exe file which is loacted in my local machine using a website?
This is like what github does when we do clone in windows option.
I need to implement exact same operation . I have a button and when I click that it need to run an application.
Thanks in advance.
You installed GitHub for Windows on your computer. And this installation registered the protocol github-windows: with the GitHub for Windows executable as handler. Nothing special going on here.
The only chance I see is to register your own URL scheme (as you said myapp-pdf: or something like it).
Then you can redirect (or open a new window) to a URL with your custom scheme and the browser should start your application giving you the URL as a command line parameter.
Create custom Url Schema and Map to the application
I just explain some thing I got after your inputs.
As all guys mentioned above, I need to generate a url schema for my application
I need to register the schema and application path to be executed in Windows registry. This need to handle during the installation .
http://msdn.microsoft.com/en-us/library/aa767914(v=vs.85).aspx
This link will show how to add the particular schema in windows registry and we can specify the application to be executed like mailto: for Outlook.
Thanks for SO to provide the details from here.
how do I create my own URL protocol? (e.g. so://...)
Pros
Need to check about the security issues which may occur if we are using this approach.

SSH into a shared text editor for phone screen code tests?

Is there a simple way to have someone ssh into a machine and edit a text file while I view text they are writing?
I am interested in using this for phone screen interviews. Basically, I would tell the candidate to ssh into a particular machine and edit/compile a source file to test programming ability. Ideally, I would like to see what they are typing in real time rather than only when they save.
Is there a simple solution for this?
screen is the solution to this conundrum; see the -x option to create a shared session. You can create the session beforehand and have the dialin [ :) ] account invoke screen -x -R to attach to it. (I habitually use screen -A -U -R -x.)
You could use GNU Screen's multiuser feature (also called session sharing). http://aperiodic.net/screen/multiuser
It might be easier to setup a VNC & watch them that way. TightVNC allows you to run a 'web' server that they can connect to via a browser. http://www.tightvnc.com/winst.php#start_java
I've had a nothing but good experiences using a Google Doc for this. Realtime updating and collaboration for both parties, realtime cursor positions and highlighting for both parties, and it's stored somewhere really easy to get to afterwards, with revision history.
No syntax highlighting or auto-formatting, however, but honestly it's fine without it.

How can I edit/update hosts(etc/hosts) file using any programming language

Dynamically I want to edit/update hosts(etc/hosts) file to add domain.
To edit hosts(etc/hosts) file require Admin privileged. Using Linux I can do this by this command
sudo gedit /etc/hosts
But I am trying to do this from using Programming Language.
How can i do it?
Your best bet is to use something like SSH and connect to the computer as root (or sudo in a system()), modify the file then disconnect. The added advantage of this is the convenience of prompting the user for the password.
To do this without prompting, the user would have to set up some means to accomplish it as root. I.e. setuid'ing a helper application, installing a password-less key, modifying a LDAP tree, or various other ways. That's a little 'icky' for the lack of a better term.
There's no way to make this work for user who does not normally have privilege escalation capabilities.
Your program will need to be running with appropriate privileges. One of the classic techniques is to make the file owned by root and set the setuid bit. When your program is run, it will become root and will be able to modify /etc/hosts.
That said, setuid code is risky. A bug in the code can cause the program to do something so bad that your system becomes unuseable. Certain bugs can be used by malicious users to run arbitrary programs as root and take over your system.
You still must have the right permissions to edit the file.
To change the file, open the file in read/write/append mode (ie. mode "a" using fopen()) and write the new text to the end of the file.
I'm assuming you are at the command prompt, where you could issue that sudo command ..
Provided you have the access rights, as you claim you do, then any programming language that can add a line of text to an existing textfile (or create it, when not, which is unlikely), will work. You might habe to give that programm some additional rights, but that's a different topic!
Summary: what language do you know? => use that!

Resources