Midnight Commander - Linux Slackware

Kilka porad odnośnie MC - czyli Midnight Commandera Poniżej znajdziecie porady odnośnie MC, które są przydatne dla mnie, a przy okazji może i Wam coś dadzą. Ta strona ma głównie na celu zebranie informacji tak, abym ich później nie zgubił - swojego rodzaju backup ;)

Shell link - ustawianie portu Problem: Chcemy utworzyć shell link (dla tych co nie wiedzą - to takie SSH przez MC) na niestandardowym porcie (czyli innym niż 22). Robiąc to normalnie (czyli w oknie dialogowym shell linka: user@serwer:port) niestety nie uda nam się (wyskoczy komunikat Cannot chdir to /#sh:user@somewhere.com:12345). Bardzo wkurzające - pierwszą rzeczą, którą robię na moich serwerach poza wyłączeniem logowania się przez SSH na roota to zmiana domyślnego portu SSH. A tutaj klops przy MC..

Ale co to dla nas ;) Aby poprawić ten problem będziemy musieli zrekompilować Midnight Commandera, patchując wcześniej plik fish.c (jest to biblioteka do obsługi owego shell linka - napisana specjalnie do MC.

No to rozpoczynamy :)

  1. Domyślnie zawsze Midnight Commandera stawiam z paczki - w większości przypadków u Was pewnie też tak będzie. Dlatego też teraz musimy go wywalić (pkgtool, remove, Midnight Commander).
  2. Ze strony http://www.ibiblio.org/mc/ ściągamy najnowszą wersję MC - w obecnej chwili to: http://www.ibiblio.org/pub/Linux/utils/file/managers/mc/mc-4.6.1.tar.gz
  3. Ze strony https://savannah.gnu.org/bugs/?18042 ściągamy odpowiedniego patcha - w obecnej chwili to: file #11105: fish.c.port.patch added by sav (2kB - text/plain - 2nd approximation) (gdyby jednak brakowało tego patcha na powyższym adresie to załączam go na dole strony)
  4. Mając powyższe gotowe możemy zaczynać :) Rozpakowujemy nasze źródła: tar zxvf mc-4.6.1.tar.gz
  5. Przegrywamy naszego patcha do katalogu z rozpakowanymi źródłami mc-4.6.1/vfs - uwaga - w tym katalogu już istnieje plik o nazwie fish.c, więc zadbajmy o to, żeby plik z patchem nazywał się inaczej, np fish.c.patch
  6. Wchodzimy do katalogu ze źródłami mc-4.6.1/vfs
  7. Patchujemy: patch fish.c < fish.c.patch
  8. Pozostało skompilować.. Wchodzimy znów do katalogu ze źródłami mc-4.6.1 i wykonujemy:./configure && make && make install


No i już powinno śmigać. Spróbuj uruchomić shell link wpisując dane w postaci: user@serwer:port :) Jeśli nie działa to.. kombinuj ;) SOA#1: u mnie działa ;)

Poniżej zamieszczam kod owego patcha - gdyby przypadkiem link nie działał:

--- fish.c~	2006-10-27 14:23:29.000000000 +0300
+++ fish.c	2006-10-27 14:56:12.000000000 +0300
@@ -214,7 +214,8 @@ static int
 fish_open_archive_int (struct vfs_class *me, struct vfs_s_super *super)
 {
     {
-	const char *argv[10];
+	char gbuf[10];
+	const char *argv[10];	/* All of 10 is used now */
 	const char *xsh = (SUP.flags == FISH_FLAG_RSH ? "rsh" : "ssh");
 	int i = 0;
 
@@ -224,6 +225,11 @@ fish_open_archive_int (struct vfs_class 
 #endif
 	if (SUP.flags == FISH_FLAG_COMPRESSED)
 	    argv[i++] = "-C";
+	if (SUP.flags > FISH_FLAG_RSH) {
+	    argv[i++] = "-p";
+	    g_snprintf (gbuf, sizeof (gbuf), "%d", SUP.flags);
+	    argv[i++] = gbuf;
+	}
 	argv[i++] = "-l";
 	argv[i++] = SUP.user;
 	argv[i++] = SUP.host;
@@ -323,7 +329,7 @@ fish_open_archive (struct vfs_class *me,
     SUP.user = user;
     SUP.flags = flags;
     if (!strncmp (op, "rsh:", 4))
-	SUP.flags |= FISH_FLAG_RSH;
+	SUP.flags = FISH_FLAG_RSH;
     SUP.cwdir = NULL;
     if (password)
 	SUP.password = password;
@@ -913,22 +919,23 @@ static void
 fish_fill_names (struct vfs_class *me, fill_names_f func)
 {
     struct vfs_s_super *super = MEDATA->supers;
-    const char *flags;
     char *name;
-    
+    char gbuf[10];
+
     while (super){
-	switch (SUP.flags & (FISH_FLAG_RSH | FISH_FLAG_COMPRESSED)) {
+	const char *flags = "";
+	switch (SUP.flags) {
 	case FISH_FLAG_RSH:
 		flags = ":r";
 		break;
 	case FISH_FLAG_COMPRESSED:
 		flags = ":C";
 		break;
-	case FISH_FLAG_RSH | FISH_FLAG_COMPRESSED:
-		flags = "";
-		break;
 	default:
-		flags = "";
+		if (SUP.flags > FISH_FLAG_RSH) {
+		    g_snprintf (gbuf, sizeof (gbuf), ":%d", SUP.flags);
+		    flags = gbuf;
+		}
 		break;
 	}
 

Dodaj swój komentarz
Aby dodać komentarz wystarczy podać jego treść - pozostałe pola nie są obowiązkowe. Zaznaczenie zapamiętania nicka i adresu e-mail spowoduje, iż w każdej chwili gdy wrócisz do tej strony i będziesz chciał(a) wpisać kolejny komentarz pola nick oraz e-mail zostaną automatycznie wypełnione:
 
Nick:    E-mail:

Zapamiętaj mój nick i email    Ukryj mój adres email

Wasze komentarze
 ukryj komentarze 
::yopute momde (email@gmail.com) 2017-09-20 14:41:00
ZpSWtd Keep up the abundant labor , I recite hardly any blog posts on
this locate and I believe that your blog is rattling interesting and
contains sets of fantastic information.
::Acommiddihoole2017-08-18 20:39:00
The ED as a result of that surgery could be either temporary or
permanent. Core maca in the supplier energetix can be an herb that
tests quite well for many males.
::this site (email@gmail.com) 2017-07-10 21:29:00
thj6fn Wow! This can be one particular of the most useful blogs We
have ever arrive across on this subject. Basically Wonderful. I am
also a specialist in this topic therefore I can understand your
effort.
::lucy ann (email@gmail.com) 2017-05-10 16:06:00
qYKWuZ Looking forward to reading more. Great article.Thanks Again.
Great.
::pron best (email@gmail.com) 2017-05-09 13:42:00
5rdkmN You have already known that coconut oil is not low calorie food
however.
::come here (email@gmail.com) 2017-03-05 02:19:00
gib3yL Very good blog! Do you have any tips and hints for aspiring
writers?
::click for source (email@gmail.com) 2017-01-31 20:10:00
ebl7J5 Wow, incredible blog layout! How long have you been blogging
for? you made blogging look easy. The overall look of your website is
excellent, as well as the content!
::suba bob (email@gmail.com) 2016-11-26 22:11:00
QlO4RR Utterly pent content material, thanks for information.
::huba buba (email@gmail.com) 2016-10-11 08:01:00
gPOTHX You made some first rate factors there. I regarded on the
internet for the issue and found most individuals will go along with
along with your website.
::74WRi8KS5K6V (hcipyfnjhla@outlook.com) 2016-08-07 17:06:00
These pieces really set a standard in the inytsurd.
::huba buba (email@gmail.com) 2016-08-04 08:47:00
lYeqti This excellent website definitely has all of the information I
wanted concerning this subject and didn at know who to ask.
::pork movies (email@gmail.com) 2016-07-06 01:17:00
QJzui5 There is noticeably a bunch to get on the subject of this. I
deem you completed various fantastically good points in skin texture
also.
::big dildos (email@gmail.com) 2016-05-16 00:25:00
iZH95u we came across a cool site that you simply may appreciate. Take
a appear for those who want
::fuck your mom (emai1l@gmail.com) 2016-05-13 19:02:00
I truly appreciate this post.Really looking forward to read more.
Fantastic.
::photo editor (email@gmail.com) 2016-04-06 11:45:00
a2Ly78 You have mentioned very interesting points! ps decent internet
site.
::coco service fiverr (email@gmail.com) 2016-03-31 14:36:00
jJ0Rtw Wow, marvelous blog layout! How long have you been blogging
for? you made blogging look easy. The overall look of your site is
fantastic, let alone the content!. Thanks For Your article about sex.
::fiverr cocoservice (email@gmail.com) 2016-03-01 03:01:00
vF7MYE to mind. Is it simply me or does it look like li?e some of
::iEImvEZowD2015-12-31 19:00:00
qClTHG
::fiverr crorkservice (email@gmail.com) 2015-11-28 17:26:00
XFWz5C Some genuinely quality content on this web internet site, saved
in order to my book marks.
::crork service seo (emai1l@gmail.com) 2015-11-09 22:02:00
IIKCqw I truly appreciate this post. I ave been looking all over for
this! Thank goodness I found it on Google. You ave made my day! Thank
you again
::fiverr backlinks (email@gmail.com) 2015-10-16 09:15:00
WVUNH4 A big thank you for your blog post.Thanks Again. Cool.
::link building (email@gmail.com) 2015-09-28 19:04:00
tB6uGM Magnificent web site. Plenty of helpful information here. I am
sending it to several buddies ans also sharing in delicious. And
certainly, thanks for your sweat!
::crork service (email@gmail.com) 2015-09-03 04:04:00
29xOTX Some truly superb information, Glad I observed this.
::crorkservice (email@gmail.com) 2015-05-06 06:04:00
d7UjVj Spot on with this write-up, I truly suppose this website wants
rather more consideration. I'll most likely be again to read way more,
thanks for that info.
::crork matt (email@gmail.com) 2015-03-07 10:26:00
uHhbOr It is best to participate in a contest for among the best blogs
on the web. I will advocate this web site!
::crorkz linkz (emai1l@gmail.com) 2015-01-16 02:54:00
ycyAGS Well I definitely liked studying it. This post provided by you
is very practical for correct planning.
::crorkz (email@gmail.com) 2014-11-23 19:18:00
a94RJS Spot on with this write-up, I truly think this website wants
much more consideration. I'll in all probability be once more to read
rather more, thanks for that info.
::matzcrorkz (emai1l@gmail.com) 2014-08-05 09:59:00
Q7fWkP This is one awesome blog.Much thanks again. Much obliged.
::crorkz matz (emai1l@gmail.com) 2014-08-04 08:23:00
pWZaDX Im thankful for the article.Really thank you! Great.
::mattew crorkz (emai1l@gmail.com) 2014-08-01 18:31:00
7nC239 Im thankful for the blog post.Much thanks again. Fantastic.
::awesome seo (email@gmail.com) 2014-07-04 04:48:00
r6obh4 I cannot thank you enough for the post.Much thanks again. Much
obliged.
::nice penalty removal (email@gmail.com) 2014-06-17 10:31:00
iUaiiY Thanks again for the blog post.Much thanks again. Want more.
::best seo company (emai1l@gmail.com) 2014-06-04 20:08:00
W7bRTN Really appreciate you sharing this blog.Thanks Again. Awesome.
::best prices (email@gmail.com) 2014-05-12 05:15:00
VBNTYs Really informative post.Really thank you!
::check it out (email@gmail.com) 2014-04-01 15:53:00
IB3OLR Very informative article.Much thanks again. Really Great.
::nice seo guys (email@gmail.com) 2014-03-22 17:05:00
lA92op Great blog post.Really looking forward to read more. Much
obliged.
::stunning seo guys (email@gmail.com) 2014-02-28 22:36:00
mCK1HP Really informative article.Really looking forward to read more.
Really Great.
::nice site here (email@gmail.com) 2014-01-16 18:59:00
wSRY3v Really enjoyed this post.Much thanks again. Fantastic.
::nice site here (email@gmail.com) 2014-01-16 18:12:00
qD8nlH Thanks for the blog.Really looking forward to read more.
Awesome.
::you want this now (email@gmail.com) 2013-12-15 12:05:00
zCZvS2 I cannot thank you enough for the article.Really thank you!
Really Great.
::great things to know (email@gmail.com) 2013-11-18 05:01:00
LvUJJc I really like and appreciate your blog article.Really looking
forward to read more. Keep writing.
::smashing top seo (email@gmail.com) 2013-10-26 16:46:00
clK9cz Im obliged for the blog article.Really thank you!
::link building team (Ghianni7370@yahoo.com) 2013-10-15 20:20:00
3OPJx9 A big thank you for your blog article.Really thank you! Great.
::awesome link building (Tucci7883@yahoo.com) 2013-09-24 14:39:00
zeNiAD Looking forward to reading more. Great blog post.Much thanks
again. Fantastic.
::online business (Goodall694@yahoo.com) 2013-09-13 11:02:00
8LOzsw Thanks for the article. Want more.
::the best seo service (email@gmail.com) 2013-09-05 19:27:00
Naj7aG I think this is a real great article.Thanks Again. Cool.
::OSctLJPXTWBuADvHd (news@skillsnet.com) 2013-03-14 02:59:00
Hi! Nope, it doesn't work on MacOSX 10.4.11 on a non-IR mac. Front Row
Enabler is still required, but as of today is still not avlbaaile. Is
there an activation trick for 10.4.11 that might be useful or should
we just wait for Andrew Escobar to update Front Row Enabler?
 ukryj komentarze