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...

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...

Changing Keyboard Layout To Dvorak In Ubuntu-server

Answer : I found this more straightforward and simple: sudo dpkg-reconfigure keyboard-configuration This will guide you through the process of selecting different keyboard layouts: $ dpkg-reconfigure console-data Maybe you will need to install console-data. $ sudo apt-get install console-data If you want to make changes permanent then you can use: $ dpkg-reconfigure console-setup Looks like this will work, too: $ sudo loadkeys dvorak Hat tip to http://ma.tt/2004/01/dvorak-on-linux-console/

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.

Changing Root Password Does Not Change Sudo Password

Answer : You're changing root's password. sudo wants your user's password. To change it, try plain passwd , without arguments or running it through sudo . Alternately, you can issue: $ sudo passwd <your username> The password you use for sudo is the password of your own account, not the root account. sudo is used to grant you access to commands that need to be executed as root without giving you root access directly. To change your own password, use passwd without sudo.

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

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

Clipboard Manager For Ubuntu?

Image
Answer : Glipper is a GNOME clipboard app, and Parcelite is a GTK+ clipboard manager. Both should be available to install from the repository. If you're using Unity or GNOME Shell, ClipIt is a fork of Parcellite with AppIndicator support (thanks @pydave). It has a Ubuntu package. Diodon is now in the Ubuntu repositories. Install it with: sudo apt-get install diodon -y There's also a PPA with an updated version: sudo add-apt-repository ppa:diodon-team/stable sudo apt-get update sudo apt-get install diodon unity-scope-diodon CopyQ is a cross-platform clipboard manager written in Qt that comes with many advanced features. CopyQ features: configurable history size, number of tray menu items, multiple clipboards etc.; editable and searchable clipboard history; encryption; synchronization; keyboard shortcuts for opening the clipboard history, show the tray menu and more; commands: you can define actions or commands when a text copied to the clipboard m...

Bash: Bad Substitution

Answer : The default shell ( /bin/sh ) under Ubuntu points to dash , not bash . me@pc:~$ readlink -f $(which sh) /bin/dash So if you chmod +x your_script_file.sh and then run it with ./your_script_file.sh , or if you run it with bash your_script_file.sh , it should work fine. Running it with sh your_script_file.sh will not work because the hashbang line will be ignored and the script will be interpreted by dash , which does not support that string substitution syntax. I had the same problem. Make sure your script didnt have #!/bin/sh at the top of your script. Instead, you should add #!/bin/bash For others that arrive here, this exact message will also appear when using the env variable syntax for commands, for example ${which sh} instead of the correct $(which sh)

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

Archlinux Vs Ubuntu Core?

Answer : There are many differences between Ubuntu and Arch Linux. With Ubuntu core, you get a ready-made distribution (based on Debian) aimed towards embedded devices. Arch Linux on the other hand "is what you make it". After installing Arch Linux you are left with a minimal GNU/Linux system (not based on any other distribution). It is then up to you to configure the system as you want it. To summarize; Ubuntu core is indeed tailored towards embedded systems, whereas with Arch Linux you will have to do the tailoring yourself. Arch Linux link: https://wiki.archlinux.org/index.php/Arch_Linux Ubuntu Core link: http://www.ubuntu.com/internet-of-things Since this is an embedded project. I suggest you use either buildroot or yocto. Having used both, I further suggest you use buildroot. Its easier to get started with. However, if you have the time to come up to speed, pick yocto. Either is fine and although I am big fan or Arch and Debian, either of these two buil...

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 ...

Boot Windows From GRUB Rescue

Answer : When GRUB is gone, so is the ability to boot into Windows. You would now need to boot from the Windows CD to restore the Master Boot Record (MBR). You can also use other boot CDs such as the Ultimate Boot CD for Windows, Bart PE or Hiren's Boot CD in case you don't have Windows installation media handy. Here are the steps: Boot from the Windows CD and choose "Repair". Alternatively, boot from one of the other aforementioned boot CDs and run a command prompt. For Windows 8 computers: 1. Insert disc 2. set boot order to disc at first priority 3. reboot, wait for installer to load 4. select language and keyboard type and click continue 5. DO NOT CLICK INSTALL, instead click repair my computer in the bottom left corner 6. click troubleshoot 7. click advanced 8. click command prompt and enter the commands below. Add more tutorials for Operating Systems please. Run the the following two commands in a command prompt: bootrec /fixmbr bootrec /fixboot...

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.