Posts

Showing posts with the label Ubuntu

Adding Password To .ssh/config

Answer : Solution 1: No, There is no method to specify or provide on the command line the password in a non-interactive manner for ssh authentication using a openssh built-in mechanism. At least not one what I know of. You could hardcode your password into expect script but it is not a good solution either. You definitely would want to use keypairs for passwordless authentication as Michael stated, in the end private key is pretty much a big password in the file. Solution 2: To avoid the string of comments: Yes, this is insecure (not even arguably insecure). I would strongly recommend you only do it in a lab situation on an isolated network or a similiar situation that does not involve production servers or potentientially production server without a full reset/format. I wanted to set this up as I don't think my 2950 switch supports private/public keys and I hope at some point to get that knowledge, but I am not there yet. Using an alias and sshpass this can be acc...

Alternative For WinMerge In Ubuntu

Image
Answer : Meld (alternative link) Meld is a visual diff and merge tool. You can compare two or three files and edit them in place (diffs update dynamically). You can compare two or three folders and launch file comparisons. You can browse and view a working copy from popular version control systems such such as CVS, Subversion, Bazaar-ng and Mercurial. Look at the screenshots page for more detailed features. I like diffuse: Diffuse is a graphical tool for merging and comparing text files. Diffuse is able to compare an arbitrary number of files side-by-side and gives users the ability to manually adjust line-matching and directly edit files. Diffuse can also retrieve revisions of files from Bazaar, CVS, Darcs, Git, Mercurial, Monotone, Subversion, and SVK repositories for comparison and merging. gvimdiff is handy for quick comparisons. Install gvim to get it.

Create Client Workspace Using Perforce Command-line On Ubuntu

Answer : For my builds I have a text file, which I have in perforce, containing my client. That way I know what the client looked like at that build (I don't use a spec depot). So on unix machines: $ cat client.txt | p4 client -i or for windows: type client.txt | p4 client -i creates the client from the txt file in perforce. You can create the text by doing a p4 client -o <client_name> >client.txt and change it from there. You probably want to try p4 client -i . From the help page: The -i flag reads a client specification from the standard input. The user's editor is not invoked. So you construct your client-spec in a script and pass it to p4 client -i . Additionally, -t could be helpful, too: The -t flag constructs the client view by using the specified client's view and options as a template, instead of using the existing view or creating a new default view. I use heredocs to minimize the need for temporary files export P4CLIENT=tmp_$$ p4 client -i <...

Amazon Linux AMI Vs Ubuntu

Answer : Amazon Linux AMI is a red hat based distro so things like the package installer or the tools for service manage are different, and another thing you need to consider is the way of bootstraping, amazon instances are more flexible to do some things in cloudformation in the ubuntu way the best form to do it is with cloudinit https://help.ubuntu.com/community/CloudInit, you need to consider the packages too are multiple packages that not are native supported by Amazon Linux.

Call To Undefined Function Imagecreatefromjpeg() And GD Enabled

Image
Answer : I think you've installed an incomplete version of gd . When you compile the gd extension, use the flag --with-jpeg-dir=DIR and --with-freetype-dir=DIR ps. dont forget make clean picture below is the incomplete version of gd: picture below is the complete version of gd: In my case, GD was missing after upgrading to PHP 7.3. So, I just added it by using the following command : sudo apt-get install php7.3-gd

Can't Use External IP On Hetzner VPS

Answer : Hetzner had stopped assigning public IPv4 addresses to virtual servers. As far as I can tell this change happened when they changed the product name from VQ to CX. The usage of NAT is not mentioned in the product description though. Eventually Hetzner introduced a newer cloud platform in which VMs get real public IPv4 addresses and a routed /64 IPv6 prefix. Both versions share the CX name. Virtual servers ordered in 2012 and 2013 would keep their public IPv4 address until 2019 when the VQ line was discontinued. But virtual servers ordered in 2016 only have an RFC1918 address, and Hetzner will not route a public IPv4 address to such a virtual server. They still allocated a dedicated public IPv4 address to each virtual server, which they NAT to the assigned RFC1918 address. Hetzner believed this was not a problem because it was a 1:1 NAT. As you found out, this is error prone when configuring the server. You have to know about this NAT. And you have to look up the map...

Can't Reset Root Password With --skip-grant-tables On Ubuntu 16

Answer : I found that the mysql.sock is deleted when the mysql service is stoped and mysqld_safe can't create it (I couldn't find the reason), so my solution was back up the sock folder and restore before start mysqld_safe Start server $ sudo service mysql start Go to sock folder $ cd /var/run Back up the sock $ sudo cp -rp ./mysqld ./mysqld.bak Stop server $ sudo service mysql stop Restore the sock $ sudo mv ./mysqld.bak ./mysqld Start mysqld_safe $ sudo mysqld_safe --skip-grant-tables --skip-networking & Init mysql shell mysql -u root Change password FLUSH PRIVILEGES; SET PASSWORD FOR root@'localhost' = PASSWORD('my_new_password'); For Ubuntu 19 with MySQL 8.0.17-0ubuntu2, what ended up working for me was a combination of many answers: In the MySQL's configuration file ( /etc/mysql/mysql.conf.d/mysqld.cnf on my machine), under [mysqld] , add: skip-grant-tables = 1 plugin-load-add = auth_socket.so Restart the ...

Creating A New User And Password With Ansible

Answer : I may be too late to reply this but recently I figured out that jinja2 filters have the capability to handle the generation of encrypted passwords. In my main.yml I'm generating the encrypted password as: - name: Creating user "{{ uusername }}" with admin access user: name: {{ uusername }} password: {{ upassword | password_hash('sha512') }} groups: admin append=yes when: assigned_role == "yes" - name: Creating users "{{ uusername }}" without admin access user: name: {{ uusername }} password: {{ upassword | password_hash('sha512') }} when: assigned_role == "no" - name: Expiring password for user "{{ uusername }}" shell: chage -d 0 "{{ uusername }}" "uusername " and "upassword " are passed as --extra-vars to the playbook and notice I have used jinja2 filter here to encrypt the passed password. I have added below tutorial related to this to my ...

Cannot Find Declaration To Go To In PHP Storm On Ubuntu

Image
Answer : My problem was that my whole vendor folder had somehow gotten ignored. To check and fix, navigate to "File > Settings > Project Settings > Directories" and make sure that "vendor" is not excluded . Sources: http://fuelphp.com/forums/discussion/3943/how-to-setup-code-completion-in-phpstorm Please try to enable Laravel plugin: Settings (Preferences) | Other Settings | Laravel Plugin | Enable Plugin for this Project Or here: Languages & Frameworks | Php | Laravel| Enable Plugin for this Project As said on https://confluence.jetbrains.com/display/PhpStorm/Laravel+Development+using+PhpStorm

After Installing With Pip, "jupyter: Command Not Found"

Answer : you did not log out and log in ? It should be on your path to execute. If not, pip installed executables in .local, so in a terminal: ~/.local/bin/jupyter-notebook should start notebook To be able to run jupyter notebook from terminal, you need to make sure that ~/.local/bin is in your path. Do this by running export PATH=$PATH:~/.local/bin for your current session, or adding that line to the end of ~/.bashrc to make your changes last for future sessions (e.g. by using nano ~/.bashrc ). If you edit ~/.bashrc you will need to log out and log back in to make see your changes take effect. Try python -m notebook Or, if you used pip3 to install the notebook: python3 -m notebook On Mac OS Catalina and brewed Python3.7