Install Samba Server on Raspberry Pi

0
Comments
Install Samba Server on Raspberry Pi

This is a simple tutorial on how to install and configure a Samba server on Raspberry Pi. Any Debian-based distro is suitable for this tutorial, I am using Rasbian OS but it should also work with Ubuntu Core.

Read further...

Install .NET Core 3.0 on Raspberry Pi

1
Comments
Install .NET Core 3.0 on Raspberry Pi

As you might now, .NET Core 3.0 SDK and Runtime are available on Raspberry Pi (actually, any Linux ARM32 or ARM64 architectures, as well as x64). With the new 3.0 version of .NET Core you can run your console or ASP.NET Core web site\api projects on a cheap 35$ device without any problems (do not expect high performance). We are using Raspberry Pi 3 to control our LinkedIn and Instagram automation (I will tell you about these projects when they are ready for public) via .NET Core console applications.

Read further...

Enable bash on Windows 10

0
Comments
Enable bash on Windows 10

Finally! You can now use bash and almost any linux program on your Windows 10 machine. You do not need cygwin or MinGW anymore! This will give you opportunity to use rich variety of tools available only on linux. For example wrk - a great HTTP benchmarking tool which I plan to use for a new ASP.NET Core 1.1 benchmark. Linux's user space available from Windows 10 version 1607. But it's disabled by default. To enable it you should: Go to Settings -> Updates & security -> for developers a...

Read further...

Deploy and run .NET Core application without installed runtime. Self-contained applications.

3
Comments
Deploy and run .NET Core application without installed runtime. Self-contained applications.

.NET Core framework provides one very useful feature - Self-contained application. You don't need to install any .net runtime on your computer, you can just copy your application to the target host and run it. Furthermore, you can run it on any platform (Windows, Linux, OSX)! When you create a self-contained application, after publishing, you will see the whole .net runtime next to your application. There are some advantages: You do not need to have installed .NET Core on a target machine You ca...

Read further...

[ASP.NET 5] Lazy DBContext initialization with Entity Framework 7

2
Comments
[ASP.NET 5] Lazy DBContext initialization with Entity Framework 7

I will show you how to do lazy db context initialization with Entity Framework 7. The idea is simple, we need an easy way to get database context in a request. If db context was used in the request we should call SaveChanges method and dispose used context if not we shouldn't do anything. For "client", code should look like this: public class SomeRepository { private readonly IDbContext _db; public SomeRepository(IDbContext db) { _db = db; } public void Add(Item item) { _db.Current.Items.Add(ite...

Read further...

[ASP.NET 5] Production Ready Web Server on Linux. Kestrel + Supervisord

2
Comments
[ASP.NET 5] Production Ready Web Server on Linux. Kestrel + Supervisord

In the previous article I've used nohup + su + init.d script to run kestrel in a background. But as Daniel Lo Nigro suggested in comments it's much easier to do the same with Supervisor And he was absolutelly right, config is much smaller, and you can easelly see status and output of a program. First, install supervisor: sudo apt-get install supervisor Now you can create config for your application: sudo nano /etc/supervisor/conf.d/kestrel_default.conf With following content: [program:kestrel_de...

Read further...

[ASP.NET 5] Production Ready Web Server on Linux. Run Kestrel In The Background

3
Comments
[ASP.NET 5] Production Ready Web Server on Linux. Run Kestrel In The Background

In the previous article we have installed nginx as a "gate" for our ASP.NET 5 application. Today we will see how to start kestrel server in the background. We will do even more, we will create init.d script to control our APS.NET 5 application and start it on  the system's startup. The simplest way to start kestrel in the background from console: nohup k kestrel & But if you want to start your application at the system's startup you need init.d script. Eventually, we will have following comm...

Read further...

Raspberry Pi 2 Benchmark. Linux vs Windows

4
Comments
Raspberry Pi 2 Benchmark. Linux vs Windows

I have installed Windows 10 on Raspberry Pi 2, then I have created a simple C# application for it. Now, I am curious what is the difference in performance between Windows 10 IoT Core and Raspbian. To test that I will run a simple C# code on both OS. Code I will do a simple calculation in a loop and will run this code in multiple threads. The amount of threads - 4, because Raspberry Pi 2 has 4 cores. This will load CPU up to 100%. I know that I am using different CLRs and different compilators, b...

Read further...

[vNext] Use PostgreSQL + Fluent NHibernate from ASP.NET 5 (DNX) on Ubuntu

7
Comments
[vNext] Use PostgreSQL + Fluent NHibernate from ASP.NET 5 (DNX) on Ubuntu

In the previous part we have installed APS.NET 5 application on Ubuntu, now we are gonna install and configure PostgreSQL on Ubuntu and access database from our application through NHibernate. Install and configure PostgreSQL First, install PostgreSQL: sudo apt-get install postgresql postgresql-contrib Next, set root password: sudo -u postgres psql postgres \password postgres And then create test database: sudo -u postgres createdb mydb Add Fluent NHibernate to the application Open project.json...

Read further...

How-to Restore WordPress Site

0
Comments

In conclusion of "How-to Backup WordPress Site" article, here is small instruction to restore your backup: Upload files to VPS Upload you www.tar.gz and database.sql to the new VPS. You can use WinSCP (as described here) Extract www file structure Extract files: tar -xvf www.tar.gz And copy files: cp -a www/oldsite.com/www/* /var/yoursite.com/www Change permissions: cd /var/yoursite.com/www chown www-data:www-data -R * find . -type d -exec chmod 755 {} \; find . -type f -exec chmod 644 {} \; Cre...

Read further...

[vNext] Install ASP.NET 5 (DNX) on Ubuntu

10
Comments
[vNext] Install ASP.NET 5 (DNX) on Ubuntu

ASP.NET MVC application on Linux? Easy! As you may know, Microsoft recently released a lot of their products under MIT license. .NET Core runtime, .NET CoreFX, ASP.NET 5, MVC 6, Entity Framework 7, MSBuild, everything is now available on GitHub. Our goal is: run Asp.Net MVC application with postgresql database on ubuntu server Today we are gonna start with setting up .NET environment. In the new asp.net stack you can choose between full .NET runtime and .NET Core. For now .NET Core has a lot of...

Read further...

How-to Backup Wordpress Site

1
Comments

Here are two commands to backup your wordpress site. First you need to backup database: mysqldump -uUSER -h127.0.0.1 -pPASSWORD DB_NAME > database.sql Now you can archive www root folder: tar -chvzf www.tar.gz /var/site.com/www After this manipulations you can copy this two files to the same place. How to Restore WordPress Site

Read further...

[Fixed] [ERROR] /usr/sbin/mysqld: unknown variable 'log_slow_verbosity=query_plan'

3
Comments

Error during installing MySQL server 5.5 on Ubuntu 14.04 I got following error when try to install mysql-server-5.5 on ubuntu 14.04: [ERROR] /usr/sbin/mysqld: unknown variable 'log_slow_verbosity=query_plan' After that I got start: Job failed to start To fix that: open /etc/mysql/my.cnf for edit and comment following string log_slow_verbosity=query_plan Then start installation from scratch: sudo apt-get install mysql-server

Read further...

Migrate from Apache to nginx + php-fpm and speed up your site twice

0
Comments
Migrate from Apache to nginx + php-fpm and speed up your site twice

This blog is hosted (together with mintchocolate.org) on a small VPS (1x2.8 Ghz, 256 Мб RAM, 10 Gb SSD). This VPS is shipped with apache2, php and mysql. As you can see I am using wordpress for this blog, also I have approximately 1000 unique visitors per day (half of them visit this and this articles). So it is good to have small response time. Apache First I need to measure how slow my blog is. I have used loadimpact.com to do that. This is result for apache2: [caption id="" align="aligncenter...

Read further...

[Fixed] Apache mod_status: /server-status forbidden from 127.0.0.1

1
Comments

If you have mod_status enabled but still got this error (403) when trying to connect from localhost (127.0.0.1) you can should do following: First, go to /etc/apache2/mods-enabled/status.conf and check that you have all hosts that you want to connect from is added to Allow from, something like this:   <Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from 127.0.0.1 ::1 </Location> Second, create VirtualHost configuration for 127.0.0.1 with f...

Read further...

[Solution] Cacti + RRDTool. Graph not working problem fixed

3
Comments

If you have problems with graph in your Cacti first what you should do is enable debug mode in Cacti. To enable debug mode: Go to "Graph Management" Open any graph (Localhost - Load Average) Press "Turn On Graph Debug Mode." Now you should see something like this: RRDTool Command: /usr/bin/rrdtool graph - \ --imgformat=PNG \ --start=-86400 \ --end=-300 \ --title='Localhost - Load Average' \ --rigid \ --base=1000 \ --height=120 \ --width=500 \ --alt-autoscale-max \ --lower-limit=0 \ --u...

Read further...

Обновление Unity Lens для torrents.net.ua

0
Comments
Обновление Unity Lens для torrents.net.ua

torrentsnetuasearch - Unity Lens для поиска релизов на сайте torrents.net.ua В новой версии (0.5-public3): Исправлен баг с парсингом результатов поиска Добавлена возможность отключения загрузки изображений (существенно ускоряет поиск) Для отключения загрузки изображений необходимо в /etc/torrentsnetuasearch.conf прописать: UseImagePreview=False Для установки нужно добавить репозиторий: sudo add-apt-repository ppa:druss/unity-lens-torrentsnetua sudo apt-get update И установить линзу: sudo apt-get...

Read further...

Быстрый поиск на torrents.net.ua в Ubuntu

0
Comments
Быстрый поиск на torrents.net.ua в Ubuntu

Я довольно часто пользуюсь поиском сериалов/фильмов на замечательном трекере torrents.net.ua. Так же, я давно использую Ubuntu в сочетании с Unity. Для запуска приложений я пользуюсь поиском через Dash (аналог меню "Пуск"). Поиск этот расширяем, и для этого предусмотрен API. В один из вечеров, родилась идея добавить поиск по torrents.net.ua в Unity Dash, так, just for fun :) Вот что получилось: Для установки нужно добавить репозиторий: sudo add-apt-repository ppa:druss/unity-lens-torrentsnetua s...

Read further...

urlHandler or how to open url in the right browser

1
Comments

Hi All Problem:  Due to certain habits I use the Opera browser, but unfortunately Opera does not work properly with SharePoint portals, and when I receive links to our corporate portal (in Skype, Outlook, etc...), I open it in Internet Explorer. Regular ctrl+c, ctrl+v make me sad, so I realized that I should solve this problem. Task: Write a little program,  that will track clicks on the link in the applications (Skype, Outlook, etc...) and for specific links launch Internet Explorer instead of...

Read further...

urlHandler или как открыть ссылку в нужном браузере

0
Comments

  Всем привет.  Проблема:  В силу определенных привычек я пользуюсь браузером Opera, но к сожалению Opera не очень хорошо дружит с SharePoint порталами, и поэтому когда я получаю ссылки на наш корпоративный портал (через Skype, Outlook, etc...), то открываю их в Internet Explorer. Постоянный ctrl+c, ctrl+v меня удручал, вот и надумал я решить эту проблему. Задача: Написать приложение, которое будет отслеживать клик на ссылку в приложениях (Skype, Outlook, etc...) и для определенных адресов...

Read further...

Raspbmc + LIRC GPIO Driver + XBMC

5
Comments
Raspbmc + LIRC GPIO Driver + XBMC

Hi all!   On my Raspberry Pi I am using Raspbmc. I want to connect my TV remote control to the Raspberry. I am using Raspbmc Release Candidate 3. This version alredy has LIRC GPIO driver createdy by aron, so I skip part with compiling linux kernel and lirc with aron patches. I am using TSOP 4843. Connection: Vs ---> Pin 1 GND --> Pin 6 OUT --> Pin 12 (GPIO18) Add in /etc/modules: lirc_rpi Run in bash: sudo modprobe lirc_rpi Test GPIO driver: mode2 -d /dev/lirc0 You should see: spac...

Read further...

Raspbmc + LIRC GPIO драйвер + XBMC

3
Comments

Привет всем! На своем Raspberry Pi  я использую Raspbmc. Захотелось мне подключить к нему пульт он телевизора. На момент написания статьи я использовал Raspbmc Release Candidate 3. В этой версии уже была встроена поддержка LIRC GPIO драйвера от товарища aron’a, поэтому я пропущу часть с компиляцией ядра и lirc с патчами aron’a. Я использовал ресивер TSOP 4843. Подключил я его так: Vs ---> Pin 1 GND --> Pin 6 OUT --> Pin 12 (GPIO18) В /etc/modules добавил lirc_rpi В консоли выполнил sudo...

Read further...

Нас больше 1%

0
Comments
Нас больше 1%

Инициативная группа из Испании решила опровергнуться утверждение о том, что пользователей Linux < 1%, и просит всех пользователей Linux «посчитаться» на сайте. Надеюсь осилим рубеж в 1% (с) Хабрахабр http://www.dudalibre.com/gnulinuxcounter?lang=en

Read further...

Восстановление GRUB2

0
Comments
Восстановление GRUB2

Возобновление GRUB2 или как заставить снова грузиться Linux Стоят у меня Linux Mint, но тут мне с Морготом захотелось побегать в Fifa 10 и решил я поставить на свой десктоп Масдай как вторую ОС. Начал установку, выбрал раздел, тыцнул Enter а оно мне говорит "Опа, нифига!". Ну, думаю, нифига так нифига. Ребут и тут на экране надпись Error loading operation system. Мда, приехали, даже до копирования файлов винды не дошло а оно мне уже загрузчик коцнуло. Пришлось восстанавливать... Взял Ubuntu Live...

Read further...

Установка Chromium (Google Chrome) в Ubuntu Linux

0
Comments
Установка Chromium (Google Chrome) в Ubuntu Linux

Установка Chromium (Google Chrome for Linux) в Ubuntu Linux Хоть я и не пользуюсь браузером от Google но посмотреть что оно да как не помешает, да и тестировать свои разработки не помешает и на Google`овском браузере. На Винде у меня уже давненько появится Google Chrome. Пришло время установить и на Linux сейй браузер. Называется он немного иначе, Chromium. Установка будет описана для Ubuntu 9.04 и 9.10 Можно просто скачать .deb пакет отсюдова используя команду [code lang="bash"] wget http://med...

Read further...

Перекодирование русских ID3v2 тегов в utf-8 под Linux

0
Comments

Перекодирование русских ID3v2 тегов в utf-8 под Ubuntu Linux После перехода с масдая на линь, у меня осталась небольшая коллекция музыки. Часть из нее была русского и украинского производства. К сожалению те кто грабил музыку с дисков поленился записать ID3v2 теги в кодировке utf-8 а загнал их в "проклятой" windows-1251. И что получается, добавляю я значит, в Rhythmbox папку с музыкой, а оно мне в списке воспроизведения выдает какозабли... Нехорошо подумал я. но править по одному теги мне ой как...

Read further...

Русский язык в Qt приложениях

1
Comments

Столкнулся я с проблемой кодировки русских символов в Qt приложениях под linux(под винду еще не проверял). В Qt Creator все нормально отображается, файл сохранен в utf-8, но при запуске приложения я видел какозабли. Пробовал перекодировать сам исходник, не помогало. И вот потом я наткнулся на вот эту статью и нашел решение проблемы. Нужно подключить заголовочный файл QTextCodec и использовать вызов статического метода setCodecForTr() или setCodecForCStrings() класса QTextCodec. Первый метод прим...

Read further...

Gentoo Linux vs Ubuntu Linux

0
Comments
Gentoo Linux vs Ubuntu Linux

Gentoo Linux vs Ubuntu Linux В материале представлены результаты исследования производительности Gentoo Linux, собранного из исходных текстов с различными режимами оптимизации, в сравнении с Ubuntu 9.04. В среднем различия не столько существенны и по общему зачету наиболее оптимальные показатели обеспечивает режим "-O2", при котором кроме того был получен наименьший размер исполняемых файлов после сборки. Производительность сборок, подготовленных с использованием опций "-O2" и "-O3" достаточно б...

Read further...

Установка tuxguitar в Ubuntu Linux

0
Comments
Установка tuxguitar в Ubuntu Linux

tuxguitar - довольно неплохой редактор табулатур под Linux. Конечно до функционала GuitarPro ему еще очень далеко, но с основными задачами он прекрасно справляется. начнем [code lang="bash"] sudo apt-get install tuxguitar [/code] у меня он вытянул с интернета порядка 60 МиБ. Запускаем и тестим. Если нет звука тогда [code lang="bash"] sudo apt-get install timidity timidity-interfaces-extra [/code] В tuxguitar "Инструменты - Настройки - Песня" выбираем вывод через timidity Перезапускаем tuxguitar...

Read further...

Ubuntu / Kubuntu install party

0
Comments
Ubuntu / Kubuntu install party

Ubuntu / Kubuntu install party 29.10.2009 состоялась ubuntu install party у Друсса на хате! Вот вам пару фоточек! Ставим) Убунта на моем компе почти доставилась На ноут САДМа уже стала Кубунта А вот и все три кросавца Кубунту, Убунту, Масдай Ну и конечно мы! САДМ и Я! В общем было весело. Поговорили, поустанавливали, разошлись в 3 ночи.

Read further...

KDE vs GNOME

1
Comments
KDE vs GNOME

Крик души GNOME vs KDE Решил я написать про извечную борьбу, или даже скорее не борьбу а про выбор. Знакомство с Linux у меня начиналось с Kubutu 6.06 и честно она мне на понравилась. Вроде все было нормально, но что то "муляло" мне глаза, и "муляло" мне их KDE3. Потом была Kubuntu 9.04 и снова что то не так, хоть все красиво (KDE4) я все равно не чувствовал себя комфортно как бы я не настраивал внешний вид системы, и мне приходилось возвращаться к Масдаю. Но в один прекрасный вечер я решил пост...

Read further...

Qt4 + Linux/Windows

0
Comments

Qt4 + Linux Начал я читать книжечку Qt4. Профессиональное программирование на C++. И понятное дело что после начала прочтения мне захотелось опробовать все на практике. В книге не плохо описан процесс создания программы. Во время написания книги еще не было QtCreator, был только QtDesigner который позволял создавать и редактировать формочки, но процесс компиляции все равно проходил из командной строки. Меня это не устраивало, не зная о QtCreator я установил QtSDK (в который входит QtCreator) пот...

Read further...

Flash Player в Opera на Ubuntu Linux amd64

1
Comments

Flash Player в Opera на Ubuntu Linux 64 bit качаем плагин по ссылке http://download.macromedia.com/pub/labs/flashplayer10/libflashplayer-10.0.32.18.linux-x86_64.so.tar.gz или заходим на http://adobe.com и там ищем "Flash Player Linux 64" После чего распаковываем наш архив. Открываем Оперу и идем в меню: Инструменты - Настройки - Дополнительно - Содержимое - Настройки плагинов и смотрим какие папки у нас прописаны. Там точно есть /usr/lib/opera/plugins Далее копируем тот файл который был в архиве...

Read further...

Google Earth / Ubuntu

0
Comments

Google Earth / Ubuntu Захотелось мне поставить на любимую *убунту замечательнейшую прогу под названием Google Earth. В установке все оказалось простым. Заходим на http://earth.google.com/ выбираем пункт "Скачать". После скачивания бинарника делаем в консоли [code lang="bash"]chmod +x GoogleEarthLinux.bin ./GoogleEarthLinux.bin[/code] Все, прога установлена. После запуска я увидел границы стран, но текстур, к сожалению, не было. Все решилось следующим образом. Заходи в меню "Инструменты->Настр...

Read further...

Windows vs Linux

1
Comments
Windows vs Linux

Данная статья не является сравнением двух ОС, это скорее крик души. Так как я давно для себя понял что Windows must die а Linix forever но я все равно остаюсь зависимым от Винды. Даже сейчас во мне идет внутренняя борьба. И не известно чем она закончится до окончания написания статьи. Я долго юзал винду на десктопе, был я ей вполне доволен, потом я открыл для себя FreeBSD но не в роли десктоп ОС а в роли серверной. И даже сейчас я считаю что лучше ничего быть и не может. Как полноценный декстоп...

Read further...

Пароль средствами .htaccess и .htpasswd

0
Comments

Пароль средствами .htaccess и .htpasswd Цель: Запаролить отдельную папку сайта. Например у нас есть сайт http://example.com и нам надо поставить пароль на папку http://example.com/admin/ Справится с этой задачей легко, и этом нам помогут два файла: .htaccess и .htpasswd. Сначала создадим в паке admin файл .htaccess с таким содержимым: [code lang="apache"]AuthUserFile /полный_путь_к_файлу/.htpasswd AuthGroupFile /dev/null AuthName подсказка AuthType Basic require valid-user [/code] Директива Auth...

Read further...