A következő címkéjű bejegyzések mutatása: ubuntu. Összes bejegyzés megjelenítése
A következő címkéjű bejegyzések mutatása: ubuntu. Összes bejegyzés megjelenítése

2020. május 28., csütörtök

Resolving the 502 Bad Gateway Error in Nginx, Ubuntu 16.04 - 20.04 upgrade and PHP5 - PHP7 upgrade

PHP 7.2 Ubuntu 20.04 502 Bad gateway Error message

Set path correctly in
sudo nano /etc/nginx/sites-available/default
sudo nano /etc/nginx/snippets

BAD: fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
GOOD: fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
---


sudo nano /etc/php/7.0/fpm/pool.d/www.conf

change
listen = 127.0.0.1:9000
to
listen = /var/run/php7.2-fpm.sock


sudo apt-get -y install php7.2 php7.2-mysql php7.2-fpm php-fpm

chown :www-data /var/run/php/php7.2-fpm.sock

sudo apt install php-mysql

Reading package lists... Done
Building dependency tree     
Reading state information... Done
The following additional packages will be installed:
  php7.2-mysql
The following NEW packages will be installed:
  php-mysql php7.2-mysql
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 125 kB of archives.
After this operation, 432 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main i386 php7.2-mysql i386 7.2.24-0ubuntu0.18.04.6 [123 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic/main i386 php-mysql all 1:7.2+60ubuntu1 [2,004 B]
Fetched 125 kB in 0s (266 kB/s)     
Selecting previously unselected package php7.2-mysql.
(Reading database ... 86153 files and directories currently installed.)
Preparing to unpack .../php7.2-mysql_7.2.24-0ubuntu0.18.04.6_i386.deb ...
Unpacking php7.2-mysql (7.2.24-0ubuntu0.18.04.6) ...
Selecting previously unselected package php-mysql.
Preparing to unpack .../php-mysql_1%3a7.2+60ubuntu1_all.deb ...
Unpacking php-mysql (1:7.2+60ubuntu1) ...
Setting up php7.2-mysql (7.2.24-0ubuntu0.18.04.6) ...

Creating config file /etc/php/7.2/mods-available/mysqlnd.ini with new version

Creating config file /etc/php/7.2/mods-available/mysqli.ini with new version

Creating config file /etc/php/7.2/mods-available/pdo_mysql.ini with new version
Setting up php-mysql (1:7.2+60ubuntu1) ...
Processing triggers for libapache2-mod-php7.2 (7.2.24-0ubuntu0.18.04.6) ...
Processing triggers for php7.2-fpm (7.2.24-0ubuntu0.18.04.6) ...
NOTICE: Not enabling PHP 7.2 FPM by default.
NOTICE: To enable PHP 7.2 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php7.2-fpm
NOTICE: You are seeing this message because you have apache2 package installed.



sudo service php7.2-fpm restart
sudo service php-fpm restart
sudo service nginx restart


Check /var/log/nginx/error.log if sth is still not ok.

2018. április 24., kedd

Oneplus One Android update on Ubuntu

USE FOR YOUR OWN RISK - only upgrade your phone if you know what you're doing!

Download latest:
https://dl.twrp.me/bacon/twrp-3.2.1-0-bacon.img.html
https://devsjournal.com/top-10-custom-rom-for-oneplus-one-bacon.html

apt install android-tools-adb
apt install adb
apt install fastboot

adb devices

lsusb
Bus 001 Device 010: ID 18d1:d00d Google Inc.

sudo nano /etc/udev/rules.d/51-android.rules

SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="d00d", MODE="0666" GROUP="androiddev", SYMLINK+="android%n"

sudo service udev restart

sudo fastboot devices

If device is not shown, do this:

https://stackoverflow.com/questions/46128913/list-of-devices-attached-is-empty-on-ubuntu-16-04-using-adb-devices
https://www.youtube.com/watch?v=HGbcVoR4i74

sudo fastboot devices
sudo fastboot oem unlock
sudo fastboot flash recovery recovery.img
fastboot boot recovery.img


2018. február 12., hétfő

Monero bányászat - xmr-stak telepítése Ubuntu 17.10

# https://github.com/fireice-uk/xmr-stak/blob/master/doc/compile_Linux.md
# Ubuntu / Debian

 sudo apt install -y libmicrohttpd-dev libssl-dev cmake build-essential libhwloc-dev g++-5
git clone https://github.com/fireice-uk/xmr-stak.git
mkdir xmr-stak/build
cd xmr-stak/build
cmake ..
make install

 gedit CMakeCache.txt # I haven't found a way to pass this parameter to cmake
# find CUDA_NVCC_FLAGS:STRING=
# change it to CUDA_NVCC_FLAGS:STRING=-ccbin gcc-5
# save, exit

echo "Press ENTER if you're done."
read


make

2017. április 9., vasárnap

Luks-AES Ubuntu teljes lemez titkosítása

/etc/crpyttab 
/etc/fstab
ELLENŐRZÉSE - SDA vagy SDB valtozik ha a lemezek valtoznak!

root UUID=00000000-1111-2222-3333-444444444444 none luks
home UUID=00000000-1111-2222-3333-555555555555 none luks



# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/mapper/root /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda5 during installation
UUID=ABC00000-1111-2222-3333-444444444444 /boot           ext2    defaults        0       2
/dev/mapper/home /home           ext4    defaults        0       2



/sbin/cryptsetup not found

device-mapper: table ioctl on sda6_crypt failed: No such device or address
Command failed
cryptsetup: WARNING: failed to determine cipher modules to load for sda6_crypt

sudo -i

echo "raid1" >> /etc/initramfs-tools/modules
echo "raid456" >> /etc/initramfs-tools/modules
echo "aes-x86_64" >> /etc/initramfs-tools/modules
echo "aes" >> /etc/initramfs-tools/modules
echo "sha512-ssse3" >> /etc/initramfs-tools/modules
echo "xts" >> /etc/initramfs-tools/modules
echo "dm-mod" >> /etc/initramfs-tools/modules
echo "dm-crypt" >> /etc/initramfs-tools/modules

#------

sudo cryptsetup luksOpen /dev/sda6 sda6_crypt
sudo mkdir /media/sda6_crypt
sudo mount /dev/mapper/sda6_crypt /media/sda6_crypt
sudo mount --bind /dev /media/sda6_crypt/dev/
sudo mount /dev/sda5 /media/sda6_crypt/boot/
sudo chroot /media/sda6_crypt/

mount -t proc proc /proc
mount -t sysfs sys /sys
update-initramfs -u -k all
update-grub


umount /proc
umount /sys
exit

umount /media/sda6_crypt/boot/
umount /media/sda6_crypt/dev/
umount /media/sda6_crypt/proc
umount /media/sda6_crypt/sys
umount /media/sda6_crypt


https://answers.launchpad.net/ubuntu/+source/cryptsetup/+question/293750

2016. július 24., vasárnap

Ubuntu 16.04 hang probléma

pacmd list-cards

# Ezt a parancsot futtatva keressük meg az az Index értéket ahol ezt látjuk "output:analog-stereo".
# Pl. lehet 1-es az Index, de cseréljük ki ezt a számot lejjebb mindhárom helyen, ha mást látunk.

pacmd set-card-profile 1 output:analog-stereo
# Tartós beállítás
sudo echo "set-card-profile 1  output:analog-stereo" > /etc/pulse/default.pa
sudo echo "set-default-sink 1" > /etc/pulse/default.pa

pulseaudio -k
pulseaudio -D


*** Ha a fentiek újraindítás után sem működnek, akkor az alábbi parancsokat is adjuk ki, majd próbáljuk újra *** 


sudo apt-get purge alsa-base pulseaudio
sudo apt-get install alsa-base pulseaudio
sudo apt-get install pavucontrol

sudo alsa force-reload
sudo alsa force-reload

killall pulseaudio; rm -r ~/.config/pulse/* ; rm -r ~/.pulse*
pulseaudio -k

2016. július 17., vasárnap

Hangfelvétel jó minőségben (Ubuntu + PulseAudio)

"pavucontrol" telepítése:
sudo apt-get install pavucontrol

"audacity" telepítése:
sudo apt-get install audacity

"pulse*" hangfelvevő mód kiválasztása az Audacity-ban (Edit/Preferences/Device - Szerkesztés/Beállítások/Eszköz/Felvételi mód)

Felvétel indítása

Nyisd meg a PulseAudio hangerőszabályzót (start menüben keress rá)

Válaszd ki a "Felvétel" fület

Látnod kell az ALSA plugin feliratot ha megy a felvétel

Válaszd ki a belső hangforrást és kész is!

http://askubuntu.com/questions/229352/how-to-record-output-to-speakers

2016. június 23., csütörtök

Pgadmin3 install Ubuntu 16.04 and change PostgreSQL user password

Pgadmin3 telepítése Ubuntu 16.04 rendszerre
sudo apt-get install pgadmin3=1.22.0-1 pgadmin3-data=1.22.0-1


PostgreSQL jelszó megváltoztatása:
sudo -u postgres psql
\password
\q

sudo service postgresql restart


További beállítások:
sudo nano /etc/postgresql/9.4/main/pg_hba.conf

md5 - jelszó
trust - jelszó nélküli belépés

2016. június 18., szombat

DVD lejátszás Ubuntun

Ubuntu 15.10+
sudo apt-get install libdvd-pkg

Ubuntu 12.04-15.04
sudo apt-get install libdvdread4
sudo /usr/share/doc/libdvdread4/install-css.sh

https://help.ubuntu.com/community/RestrictedFormats/PlayingDVDs

2016. június 16., csütörtök

Ruby on Rails with rvm - Ubuntu 14.04

Set Terminal/Edit/Profile pref./Title and command / Run command as a login shell (TICK ON)

\curl -L https://get.rvm.io | bash -s stable --ruby
rvm get stable --autolibs=enable
rvm install ruby
rvm --default use ruby-2.3.0

2016. június 15., szerda

XRDP magyar billentyűzet kiosztás (Ubuntu 14.04 + Xcfe RDP)

Ha már megy a távoli asztal:
https://forraskod.blogspot.hu/2016/06/xrdp-tavoli-asztal-ubuntuxfce.html

de jó jönne a magyar billentyűzet kiosztás is:
  • sudo mv /etc/xrdp/km-0409.ini /etc/xrdp/km-0409.ini.backup
  • sudo nano /etc/xrdp/km-0409.ini
  • km-0409.ini szakaszt (alább, További bejegyzések ») másold be a fájlba
  • sudo service xrdp restart
Kész!


-------------------------------------------------------
Kézi előállítás:
-------------------------------------------------------

ssh -X SERVERNAME_OR_IPADDRESS

setxkbmap -model pc105 -layout hu
# Több nyelv kódja
# https://sourceforge.net/p/rdesktop/code/1704/tree/rdesktop/trunk/keymaps/

xrdp-genkeymap km-040E.ini
# https://sourceforge.net/p/rdesktop/code/1704/tree/rdesktop/trunk/doc/keymap-names.txt

sudo mv /etc/xrdp/km-0409.ini /etc/xrdp/km-0409.ini.backup
sudo cp km-040E.ini /etc/xrdp/km-0409.ini

sudo service xrdp restart



----------------------------------------------------------------
A kiosztás nem tökéletes, továbbí javításokhoz ajánlott a xev program:
http://linux.die.net/man/1/xev
----------------------------------------------------------------

Forrás:

2016. május 3., kedd

Wifi hotspot: Ethernet kapcsolat + Wifin internet megosztás

EN: Wifi hotspot: Internet with Ethernet connection + Share internet on WiFi

1. Hálózat készítése ezzel a névvel: wifi-hotspot
2. IPv4 kapcsolat megosztott-ra állítása, WPA2-PSK titkosítás és jelszó beállítása.
3. sudo perl -pi -e 's?mode=infrastructure?mode=ap?' /etc/NetworkManager/system-connections/wifi-hotspot
4. Hálózat újraindítása (ki- és bekapcsolás)
Kész!

Megosztott az internetkapcsolat? A fenti fájlnak tartalmaznia kell ezt:
[ipv4]
method=shared

http://askubuntu.com/questions/490950/create-wifi-hotspot-on-ubuntu

2016. január 24., vasárnap

Linux háttérkép véletlenszerű idézetekkel - Linux wallpaper with random tagline

cd
wget https://raw.githubusercontent.com/sicambria/py/master/misc/walltext.py
wget http://pastebin.com/raw/txZBq8m3 -O notes.txt
wget https://upload.wikimedia.org/wikipedia/commons/1/15/Thin_Line_of_Earth%27s_Atmosphere_and_the_Setting_Sun.jpg -O original.jpg
echo "python3 ~/walltext.py &" >> ~/.profile

Kézi futtatás - Manual run:
python3 ~/walltext.py

Eredeti kód:
http://askubuntu.com/questions/556723/make-a-text-file-my-automatically-updated-background

2015. november 9., hétfő

Solve shared libraries error on Ubuntu 14.04 x64: libgconf, libudev

error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory

error while loading shared libraries: libudev.so.0: cannot open shared object file: No such file or directory

Futtasd a Terminálból - Run from Terminal:

sudo apt-get install libgconf-2-4:i386
sudo apt-get install libudev1 && cd /lib/i386-linux-gnu/ && sudo ln -s libudev.so.1 libudev.so.0

2015. április 28., kedd

Skype libGL.so.1 error Ubuntu 14.04

skype: error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory
Kernel 3.16 x86_64 GNU/Linux

Run:

update-alternatives --display i386-linux-gnu_gl_conf
sudo update-alternatives --config i386-linux-gnu_gl_conf

  Selection    Path                                     Priority   Status
------------------------------------------------------------
* 0            /usr/lib/nvidia-325/alt_ld.so.conf        8602      auto mode
  1            /usr/lib/i386-linux-gnu/mesa/ld.so.conf   500       manual mode
  2            /usr/lib/nvidia-325/alt_ld.so.conf        8602      manual mode

Press enter to keep the current choice[*], or type selection number: 1

sudo ldconfig

http://askubuntu.com/questions/257897/error-loading-libgl-so-1

2014. november 14., péntek

ActiveMQ on Ubuntu 14.04 x64 VPS - Solve OutOfMemoryError, Could not reserve enough space for object heap

You need some tweaks to run ActiveMQ in a resource-constrained VPS environment, I've tried this on a VPS that had 2GB RAM.

0. Download ActiveMQ, extract to /opt/activemq and run:

./activemq setup



1. Tweak JAVA minimum heap memory and max heap size - run and also put this line to ~/.bashrc :

export JAVA_OPTS="-Xms128m -Xmx512m"


Verify settings:

echo $JAVA_OPTS
-Xms128m -Xmx512m

echo $_JAVA_OPTIONS

(empty)



2. Limit resource usage (memoryUsage -> 32MB):
nano conf/activemq.xml

          <systemUsage>
            <systemUsage>
                <memoryUsage>
                    <memoryUsage limit="32 mb"/>
                </memoryUsage>
                <storeUsage>
                    <storeUsage limit="10 gb"/>
                </storeUsage>
                <tempUsage>
                    <tempUsage limit="10 gb"/>
                </tempUsage>
            </systemUsage>
        </systemUsage>



3. Comment out a few transport Connectors


        <transportConnectors>
            <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
            <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>

      <!--      <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
      
-->
  </transportConnectors>




4. Set ACTIVEMQ_OPTS_MEMORY and ACTIVEMQ_OPTS

nano /etc/default/activemq

# Set jvm memory configuration
if [ -z "$ACTIVEMQ_OPTS_MEMORY" ] ; then
ACTIVEMQ_OPTS_MEMORY="-Xms128M -Xmx512M"
fi

# Uncomment to enable audit logging
#ACTIVEMQ_OPTS="$ACTIVEMQ_OPTS -Dorg.apache.activemq.audit=true"
ACTIVEMQ_OPTS="$ACTIVEMQ_OPTS -Dorg.apache.activemq.UseDedicatedTaskRunner=false"



5. Setting up proper passwords:

/opt/activemq/conf# nano jetty-realm.properties

# username: password [,rolename ...]



Error messages on a VPS with 2GB RAM before tweaks:

INFO: Loading '/etc/default/activemq'
INFO: Using java '/usr/bin/java'
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.


opt/activemq/bin/activemq console
INFO: Loading '/etc/default/activemq'
INFO: Using java '/usr/bin/java'
INFO: Starting in foreground, this is just for debugging purposes (stop process by pressing CTRL+C)
Error occurred during initialization of VM
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:714)
at java.lang.ref.Finalizer.<clinit>(Finalizer.java:226)

./activemq: 453: ./activemq: Cannot fork

ERROR: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService#0' defined in class path resource [activemq.xml]: Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: unable to create new native thread
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService#0' defined in class path resource [activemq.xml]: Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: unable to create new native thread


Environment details:

ulimit -a
core file size          (blocks, -c) unlimited
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 127259
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 127259
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

See also:

http://activemq.apache.org/javalangoutofmemory.html

2014. november 12., szerda

Kiegészítő LaTeX csomagok használata a Gummi, illetve TeX Live szerkesztőkben (Ubuntu 14.04)

Gummi TeX szerkesztő telepítése:

sudo apt-get install gummi 

Futassuk az alábbi két parancsot a Terminálból:

cd ~/.config/gummi
ln -s /usr/share/texmf-texlive

EN: Use additional LaTeX / TeX packages for Gummi or TeX Live on Ubuntu
  1. Figure out where you installed the extra packages, from TeX Live or whatever else.  (For me, they live at /usr/share/texmf-texlive/.)
  2. Create a symbolic link within the Gummi configuration folder to the TeXLive files:
    • cd ~/.config/gummi
      ln -s /usr/share/texmf-texlive
    Experimentation suggests that pointing Gummi at the top-level directory is sufficient for access to all of the subfolders.  If it fits the structure of your machine better, you could also copy or move the files — but I’d stick with a symbolic link unless you have a good plan in mind.
http://www.pamelatoman.net/blog/2013/11/using-additional-packages-with-gummi/

2014. november 3., hétfő

GRUB és indítóképernyő testreszabás

EN: Customize GRUB wallpaper and boot splash logo - Ubuntu 14.04

GRUB háttérkép beállítása:

Válasszunk ki egy nem-indexelt, RGB típusú PNG képet 640x480-as felbontásban (wallpaper.png)

sudo cp wallpaper.png /boot/grub/
sudo update-grub

Indítóképernyő:

Töltsd le és csomagold ki a ZIP fájlt:
http://data.hu/get/8188574/ubuntu-boot-myimage.zip

sudo cp -r ubuntu-boot-myimage '/lib/plymouth/themes'
sudo mv '/lib/plymouth/themes/default.plymouth' '/lib/plymouth/themes/default.plymouth.backup'
sudo ln -s '/lib/plymouth/themes/ubuntu-boot-myimage/ubuntu-faded-screen.plymouth' '/lib/plymouth/themes/default.plymouth'
sudo update-initramfs -u

2014. november 2., vasárnap

Bejelentkezési probléma sudo startx futtatása után

EN: After running sudo startx, system does not log in on Ubuntu Linux.

Problem: user root became owner of ~/.Xauthority file

Solution:
Press CTRL+ALT+F1, log in and run:
sudo chown USERNAME .Xauthority
sudo chgrp USERNAME .Xauthority

Where USERNAME is your user (login) name.

2014. október 16., csütörtök

Oneplus One USB transfer in Ubuntu 14.04 x64

USB adatátvitel OnePlus One telefonra Ubuntu 14.04 Linux rendszeren:

gksu gedit /lib/udev/rules.d/69-libmtp.rules

Adding the following entries did the trick:

ATTR{idVendor}=="05c6", ATTR{idProduct}=="6764", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1", TAG+="uaccess"

ATTR{idVendor}=="05c6", ATTR{idProduct}=="6765", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1", TAG+="uaccess"

Restart udev:
sudo service udev restart

Reconnect the device and it should work. Make sure that MTP transfer mode is selected on your phone.

http://askubuntu.com/questions/505932/ubuntu-14-04-mtp-error