вторник, 1 декабря 2020 г.

MySQL query to get column names

SELECT `COLUMN_NAME` 
FROM `INFORMATION_SCHEMA`.`COLUMNS` 
WHERE `TABLE_SCHEMA`='yourdatabasename' 
    AND `TABLE_NAME`='yourtablename';

четверг, 11 октября 2018 г.

Applications Don't Show Up in Spotlight


Applications Don't Show Up in Spotlight


  1. Go to System Preferences, Select Spotlight
  2. Go to the Privacy tab in the Spotlight system preferences
  3. Click the "+" button
  4. Press Shift-Command-C to reveal your hard drives (if they are not available otherwise), or simply navigate to your hard drive (most likely MacintoshHD)
  5. If you have more than one hard drive, hold the Command key and click your various drives to add them to your selection
  6. Click the “Choose” button to add them to the Privacy list
  7. Ignore the warning.
  8. Remove the hard drive by clicking the "-" sign.
  9. Have a nice day :)



вторник, 31 июля 2018 г.

среда, 23 мая 2018 г.

Ubuntu 16.04 : Configure WOL

  • Set in /etc/default/tlp
  • WOL_DISABLE=N 
  • Set in /etc/default/halt
  • NETDOWN=no 

  • execute
  • sudo ethtool -s eth0 wol g
  • check
  • sudo ethtool eth0
    Settings for eth0:
    
             ...
      Supports Wake-on: g
      Wake-on: g
      Link detected: yes

воскресенье, 10 января 2016 г.

serial console

Create /etc/init/ttyS0.conf
start on stopped rc RUNLEVEL=[12345]
stop on runlevel [!12345]

respawn
exec /sbin/getty -L 115200 ttyS0 vt102
Start:
sudo start ttyS0
FROM

пятница, 6 марта 2015 г.

Python костыльный метод удаления

Для "ручного" удаленния после установки
python setup.py install --record files.txt
cat files.txt | xargs rm -rf
где files.txt - список установленsх файлов (с абсолютным путем)

четверг, 5 марта 2015 г.

GNS3 v1.2.3

  1. To change default theme
  2. Edit -> Preferences -> General
    General Tab -> Style -> Legacy
    Old
    New

  3. Edit console style
  4. Edit -> Preferences -> General
    Console applications Tab - > Console application command:
    putty -telnet %h %p -title "%d" -sl 2500 -fg yellow -bg BLACK -fn "client:Monospace 12" -fb "client:Monospace Bold 12"

пятница, 21 ноября 2014 г.

LibreOffice: default page A4

Creating a new default template

If you want every new document to have user-defined settings, you must create a new template and set it as default.
  1. Create a new document, add or modify styles, and change other settings as you desire.
  2. From the File menu, choose Templates -> Save.
  3. Give the template a name.
  4. Select a category in the Categories list (for example, My Templates).
  5. Click OK to save the template.
  6. Choose File -> Templates -> Organize.
  7. In the Categories list, double-click on the My Templates folder.
  8. Right-click on the template you want to use and choose Set as Default Template from the menu.
  9. Click the Close button.

Do this for Writer & Calc

среда, 19 ноября 2014 г.

пятница, 7 ноября 2014 г.

AMD APU CPU: No sensors found

AMD APU CPU:
  1. dmidecode
    # dmidecode -t processor| grep -i version
     Version: AMD A8-5600K APU with Radeon(tm) HD Graphics
  2. cpuinfo
    # cat /proc/cpuinfo | grep name| head -1
    model name : AMD A8-5600K APU with Radeon(tm) HD Graphics 
# sensors-detect
...
Sorry, no sensors were detected.
...

Solution:
  • Add to /etc/modprobe.d/lm_sensors.conf
    options it87 force_id=0x8728
  • Load module it87
    modprobe it87
$ sensors
it8728-isa-0290
Adapter: ISA adapter
in0:          +1.04 V  ..... 
in1:          +1.66 V  ..... 
in2:          +2.00 V  ..... 
+3.3V:        +4.01 V  ..... 
in4:          +1.19 V  ..... 
in5:          +2.23 V  ..... 
in6:          +2.23 V  ..... 
3VSB:         +3.31 V  ..... 
Vbat:         +3.24 V  
fan1:        2014 RPM  ..... 
fan2:           0 RPM  ..... 
fan4:        1403 RPM  ..... 
temp1:        +27.0°C  ..... 
temp2:        +29.0°C  ..... 
temp3:       -128.0°C  ..... 
intrusion0:  OK

Profit!


FROM

вторник, 4 ноября 2014 г.

Cloning Windows Server 2008 R2: Use Sysprep (no more NewSID)

  1. Run Sysprep
    (on Windows Server 2008 this is located in:
    c:\Windows\System32\Sysprep\Sysprep.exe)
  2. Ensure System Out-of-Box Experience (OOBE) is selected
  3. Tick the Generalize option (this resets the SID)
  4. Select Shutdown from the Shutdown Options.
  5. Once the machine has shutdown, take your image and you are good to go!


from

четверг, 30 октября 2014 г.

ROOT LG L90

  • Format sdcard using into ext2.
    mkfs.ext2 /dev/sdX1
  • Download update.zip
    Move it to your ext2 sdcard

  • Install Android SDK or
    • for Debian Wheezy:
      Add to /etc/apt/sources.list
      deb http://ftp.debian.org/debian wheezy-backports main 
      Update & install android-tools-adb
      sudo apt-get update && sudo apt-get install android-tools-adb
  • Prepare your phone.
    Turn on USB debugging:
    Settings –> General –> Developer options –> USB debugging.

    If you don’t see it:
    Settings –> General –> About phone –> Common –> Software info
    – click 5-10 times on Build number.
  • Connect phone & run Terminal:
    adb devices
    adb shell
    reboot recovery
  • Disconnect phone, plug in sdcard
  • In recovery choose "apply update from external sdcard"update.zip
    Choose "reboot system now"

    The phone will reboot.


FROM
Profit!

пятница, 24 октября 2014 г.

Brother MFC-7860DWR: install scanner

Download driver for scanner from LINK

  • Open terminal & switch to root
    sudo su -
  • Install driver
    dpkg  -i --force-all brscan4-0.4.2-1.amd64.deb
  • Check if driver installed
    dpkg -l | grep Brother
  • Add scanner via IP
    brsaneconfig4 -a  name=Brother_scan  model=MFC-7860DW  ip=192.168.0.10
  • Check
    brsaneconfig4 -q  |  grep Brother
PROFIT!

понедельник, 13 октября 2014 г.

Debian Mozilla (Wheezy)

  • Add to /etc/apt/sources.list next line
    deb http://mozilla.debian.net/ wheezy-backports iceweasel-release
    
  • Download pkg-mozilla-archive-keyring
  • Install deb-package
    sudo dpkg -i pkg-mozilla-archive-keyring*
  • Update repos & install newest Iceweasel:
    sudo apt-get update
    sudo apt-get install -t wheezy-backports iceweasel
    

debian-multimedia repo: GPG error


# apt-get update 
...
...
...
 W: GPG error: http://www.deb-multimedia.org testing InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 07DC563D1F41B907
Solution:
 apt-get install deb-multimedia-keyring

пятница, 26 сентября 2014 г.

Friefox .. Ctrl+Q: Upd1

В очередной (многомиллионный) раз промахнулась мимо Ctrl + w и нажала Ctrl + q.
Естественно, мой браузер закрылся утянув за собой все вкладки, которые были открыты.
Запустила Firefox по-новой ... и ... History -> Restore Previous Session.
Profit!

Но более оптимальное решение - это установка addon-а Disable Ctrl-Q Shortcut

четверг, 25 сентября 2014 г.

Заметки на полях ч1. Аналоги Linux-команд для Windows

tail

(показать последние 10 строк)
Linux
tail -10 FILE
tail -n 10 FILE
cat FILE | tail -10  
cat FILE | tail -n 10  
Windows
Get-Content FILE | Select-Object -Last 10
gc FILE |select -Last 10 

tail -f

(выводить поступающие данные по мере роста файла)
Linux
cat FILE | tail -f
Windows
Get-Content FILE -Wait
gc FILE -Wait

last reboot + uptime

(время последней перезагрузки + время работы системы)
Linux
last reboot
uptime
Windows
systeminfo | find /i "Boot Time"
wmic os get lastbootuptime
Get-EventLog System | Where-Object {$_.EventID -eq "6005"}

grep -v

(исключить строки)
K & M : IT - PowerShell: "grep -v"

Python: открытие века

Запуск HTTP-сервера в текущей директории на 8000 порту.
Если в директории нет файла index.html, то будет показан её листинг.
python -m SimpleHTTPServer
!!! для меня это открытие !!!

понедельник, 1 сентября 2014 г.

Skype 4 & Debian 7 x64

Установка Skype для архитектур amd64 для Debian 7
# dpkg --add-architecture i386
# apt-get update